Views
No views yet
| Metric | Score |
|---|---|
| F1 Micro | 0.796 |
| F1 Macro | 0.551 |
| Techniques with F1 ≥ 0.3 | 15/18 |
| Technique | F1 | Support |
|---|---|---|
| Name_Calling,Labeling | 0.960 | 724 |
| Appeal_to_Authority | 0.897 | 16 |
| Red_Herring | 0.880 | 14 |
| Obfuscation,Intentional_Vagueness,Confusion | 0.800 | 6 |
| Loaded_Language | 0.796 | 480 |
| Whataboutism,Straw_Men,Red_Herring | 0.700 | 26 |
| Slogans | 0.667 | 4 |
| Appeal_to_fear-prejudice | 0.662 | 246 |
| Reductio_ad_hitlerum | 0.612 | 68 |
| Doubt | 0.564 | 23 |
| Exaggeration,Minimisation | 0.524 | 146 |
| Flag-Waving | 0.467 | 23 |
| Repetition | 0.444 | 7 |
| Bandwagon | 0.400 | 8 |
| Black-and-White_Fallacy | 0.300 | 17 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model
5tokenizer = AutoTokenizer.from_pretrained("vinai/bertweet-base", use_fast=False)
6model = AutoModelForSequenceClassification.from_pretrained("synapti/nci-social-classifier-v3")
7
8# Technique labels
9TECHNIQUES = [
10 "Loaded_Language", "Appeal_to_fear-prejudice", "Exaggeration,Minimisation",
11 "Repetition", "Flag-Waving", "Name_Calling,Labeling", "Reductio_ad_hitlerum",
12 "Black-and-White_Fallacy", "Causal_Oversimplification", "Whataboutism,Straw_Men,Red_Herring",
13 "Straw_Man", "Red_Herring", "Doubt", "Appeal_to_Authority", "Thought-terminating_Cliches",
14 "Bandwagon", "Slogans", "Obfuscation,Intentional_Vagueness,Confusion",
15]
16
17# Predict
18text = "Build the wall! Build the wall! Build the wall! #MAGA"
19inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
20
21with torch.no_grad():
22 outputs = model(**inputs)
23 probs = torch.sigmoid(outputs.logits)[0]
24
25# Get detected techniques
26detected = [(TECHNIQUES[i], float(probs[i])) for i in range(18) if probs[i] > 0.3]
27print(detected)
28# [('Slogans', 0.51), ('Repetition', 0.39), ...]1@misc{nci-social-classifier-v3,
2 author = {Synapti},
3 title = {NCI Social Media Classifier v3},
4 year = {2024},
5 publisher = {HuggingFace},
6 url = {https://huggingface.co/synapti/nci-social-classifier-v3}
7}