synapti/nci-social-v3
Viewer • Updated • 11.3k • 27
A multi-label classifier for detecting propaganda techniques in social media content (tweets, posts, short-form text).
This model is fine-tuned from vinai/bertweet-base for multi-label classification of 18 propaganda techniques defined in the SemEval-2020 Task 11.
Key improvements in v3:
| 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 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model
tokenizer = AutoTokenizer.from_pretrained("vinai/bertweet-base", use_fast=False)
model = AutoModelForSequenceClassification.from_pretrained("synapti/nci-social-classifier-v3")
# Technique labels
TECHNIQUES = [
"Loaded_Language", "Appeal_to_fear-prejudice", "Exaggeration,Minimisation",
"Repetition", "Flag-Waving", "Name_Calling,Labeling", "Reductio_ad_hitlerum",
"Black-and-White_Fallacy", "Causal_Oversimplification", "Whataboutism,Straw_Men,Red_Herring",
"Straw_Man", "Red_Herring", "Doubt", "Appeal_to_Authority", "Thought-terminating_Cliches",
"Bandwagon", "Slogans", "Obfuscation,Intentional_Vagueness,Confusion",
]
# Predict
text = "Build the wall! Build the wall! Build the wall! #MAGA"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.sigmoid(outputs.logits)[0]
# Get detected techniques
detected = [(TECHNIQUES[i], float(probs[i])) for i in range(18) if probs[i] > 0.3]
print(detected)
# [('Slogans', 0.51), ('Repetition', 0.39), ...]
Trained on synapti/nci-social-v3:
Data sources:
@misc{nci-social-classifier-v3,
author = {Synapti},
title = {NCI Social Media Classifier v3},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/synapti/nci-social-classifier-v3}
}
Apache 2.0
Base model
vinai/bertweet-base