Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,80 +1,133 @@
|
|
| 1 |
---
|
| 2 |
-
library_name: transformers
|
| 3 |
license: apache-2.0
|
| 4 |
-
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
| 53 |
-
|
| 54 |
-
|
|
| 55 |
-
|
|
| 56 |
-
|
|
| 57 |
-
|
|
| 58 |
-
|
|
| 59 |
-
|
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
tags:
|
| 5 |
+
- propaganda-detection
|
| 6 |
+
- multi-label-classification
|
| 7 |
+
- modernbert
|
| 8 |
+
- text-classification
|
| 9 |
+
datasets:
|
| 10 |
+
- synapti/nci-propaganda-v5
|
| 11 |
+
base_model: answerdotai/ModernBERT-base
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
+
metrics:
|
| 15 |
+
- f1
|
| 16 |
+
pipeline_tag: text-classification
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# NCI Technique Classifier v5.2
|
| 20 |
+
|
| 21 |
+
Multi-label propaganda technique classifier based on ModernBERT, trained to identify 18 propaganda techniques from the SemEval-2020 Task 11 taxonomy.
|
| 22 |
+
|
| 23 |
+
## Model Description
|
| 24 |
+
|
| 25 |
+
This model is part of the NCI (Narrative Coordination Index) Protocol for detecting coordinated influence operations. It classifies text into 18 propaganda techniques with well-calibrated probability outputs.
|
| 26 |
+
|
| 27 |
+
### Key Improvements in v5.2
|
| 28 |
+
|
| 29 |
+
- **Reduced False Positives**: Scientific/factual content false positive rate reduced from 35% (v4) to 8.8%
|
| 30 |
+
- **Better Calibration**: ASL loss with clip=0.02 provides more discriminative probability outputs
|
| 31 |
+
- **Hard Negatives Training**: Trained on v5 dataset with 1000+ hard negative examples (scientific, business, factual content)
|
| 32 |
+
- **Document-Level Analysis**: Works well with full documents, no need for sentence-level splitting
|
| 33 |
+
|
| 34 |
+
### Training Details
|
| 35 |
+
|
| 36 |
+
- **Base Model**: `answerdotai/ModernBERT-base`
|
| 37 |
+
- **Dataset**: `synapti/nci-propaganda-v5` (24,037 samples)
|
| 38 |
+
- **Loss Function**: Asymmetric Loss (ASL)
|
| 39 |
+
- gamma_neg: 4.0
|
| 40 |
+
- gamma_pos: 1.0
|
| 41 |
+
- clip: 0.02 (reduced from 0.05 to minimize probability shifting)
|
| 42 |
+
- **Training**: 3 epochs, lr=2e-5, batch_size=16
|
| 43 |
+
- **Validation**: 4/7 tests passed (57%)
|
| 44 |
+
|
| 45 |
+
## Techniques Detected
|
| 46 |
+
|
| 47 |
+
| ID | Technique | Description |
|
| 48 |
+
|----|-----------|-------------|
|
| 49 |
+
| 0 | Loaded_Language | Words with strong emotional implications |
|
| 50 |
+
| 1 | Appeal_to_fear-prejudice | Building support through fear or prejudice |
|
| 51 |
+
| 2 | Exaggeration,Minimisation | Overstating or understating facts |
|
| 52 |
+
| 3 | Repetition | Repeating messages for reinforcement |
|
| 53 |
+
| 4 | Flag-Waving | Appealing to patriotism/national identity |
|
| 54 |
+
| 5 | Name_Calling,Labeling | Using labels to evoke prejudice |
|
| 55 |
+
| 6 | Reductio_ad_hitlerum | Comparing to Hitler/Nazis |
|
| 56 |
+
| 7 | Black-and-White_Fallacy | Presenting only two choices |
|
| 57 |
+
| 8 | Causal_Oversimplification | Assuming single cause for complex issues |
|
| 58 |
+
| 9 | Whataboutism,Straw_Men,Red_Herring | Deflection techniques |
|
| 59 |
+
| 10 | Straw_Man | Misrepresenting opponent's position |
|
| 60 |
+
| 11 | Red_Herring | Introducing irrelevant topics |
|
| 61 |
+
| 12 | Doubt | Questioning credibility |
|
| 62 |
+
| 13 | Appeal_to_Authority | Using authority figures to support claims |
|
| 63 |
+
| 14 | Thought-terminating_Cliches | Phrases that end rational thought |
|
| 64 |
+
| 15 | Bandwagon | "Everyone is doing it" appeals |
|
| 65 |
+
| 16 | Slogans | Catchy phrases for memorability |
|
| 66 |
+
| 17 | Obfuscation,Intentional_Vagueness,Confusion | Deliberately confusing language |
|
| 67 |
+
|
| 68 |
+
## Usage
|
| 69 |
+
|
| 70 |
+
```python
|
| 71 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 72 |
+
import torch
|
| 73 |
+
|
| 74 |
+
model_id = "synapti/nci-technique-classifier-v5.2"
|
| 75 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 76 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_id)
|
| 77 |
+
|
| 78 |
+
text = "This is OUTRAGEOUS! They are LYING to you. WAKE UP!"
|
| 79 |
+
|
| 80 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
|
| 81 |
+
with torch.no_grad():
|
| 82 |
+
outputs = model(**inputs)
|
| 83 |
+
probs = torch.sigmoid(outputs.logits)[0]
|
| 84 |
+
|
| 85 |
+
# Get techniques with probability > 0.5
|
| 86 |
+
LABELS = [
|
| 87 |
+
"Loaded_Language", "Appeal_to_fear-prejudice", "Exaggeration,Minimisation",
|
| 88 |
+
"Repetition", "Flag-Waving", "Name_Calling,Labeling", "Reductio_ad_hitlerum",
|
| 89 |
+
"Black-and-White_Fallacy", "Causal_Oversimplification",
|
| 90 |
+
"Whataboutism,Straw_Men,Red_Herring", "Straw_Man", "Red_Herring", "Doubt",
|
| 91 |
+
"Appeal_to_Authority", "Thought-terminating_Cliches", "Bandwagon", "Slogans",
|
| 92 |
+
"Obfuscation,Intentional_Vagueness,Confusion"
|
| 93 |
+
]
|
| 94 |
+
|
| 95 |
+
for i, (label, prob) in enumerate(zip(LABELS, probs)):
|
| 96 |
+
if prob > 0.5:
|
| 97 |
+
print(f"{label}: {prob:.1%}")
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
## Performance
|
| 101 |
+
|
| 102 |
+
### Validation Results
|
| 103 |
+
|
| 104 |
+
| Test Case | v5.2 | v4 | Status |
|
| 105 |
+
|-----------|------|-----|--------|
|
| 106 |
+
| Pure Propaganda | 66.8% | 70.8% | ✓ Detected |
|
| 107 |
+
| Neutral News | 6.9% | 5.5% | ✓ Clean |
|
| 108 |
+
| SpaceX Factual | 3.7% | - | ✓ Clean |
|
| 109 |
+
| Multi-Label Propaganda | 76.5% | - | ✓ Detected |
|
| 110 |
+
| Mixed Content | 7.3% | - | - |
|
| 111 |
+
| Fear Appeal | 69.9% | - | ✓ Detected |
|
| 112 |
+
| Scientific Report | **8.8%** | 35.4% | ✓ Clean |
|
| 113 |
+
|
| 114 |
+
### Key Metrics
|
| 115 |
+
|
| 116 |
+
- **Scientific Report FPR**: 8.8% (vs 35% in v4) - 75% reduction
|
| 117 |
+
- **Factual News FPR**: 4.6% (vs 29% in v4) - 84% reduction
|
| 118 |
+
- **Propaganda Detection**: Maintained (73.7% max confidence on propaganda)
|
| 119 |
+
|
| 120 |
+
## Citation
|
| 121 |
+
|
| 122 |
+
```bibtex
|
| 123 |
+
@inproceedings{da-san-martino-etal-2020-semeval,
|
| 124 |
+
title = "{S}em{E}val-2020 Task 11: Detection of Propaganda Techniques in News Articles",
|
| 125 |
+
author = "Da San Martino, Giovanni and others",
|
| 126 |
+
booktitle = "Proceedings of the 14th International Workshop on Semantic Evaluation",
|
| 127 |
+
year = "2020",
|
| 128 |
+
}
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
## License
|
| 132 |
+
|
| 133 |
+
Apache 2.0
|