synapti/nci-propaganda-production
Viewer • Updated • 23k • 7
How to use synapti/nci-binary-detector with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="synapti/nci-binary-detector") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("synapti/nci-binary-detector")
model = AutoModelForSequenceClassification.from_pretrained("synapti/nci-binary-detector")Fast binary classifier that detects whether text contains propaganda techniques.
This model is Stage 1 of the NCI (Narrative Credibility Index) two-stage propaganda detection pipeline:
The binary detector serves as a fast filter with high recall, passing flagged content to the more detailed technique classifier.
| Label | Description |
|---|---|
no_propaganda |
Text does not contain propaganda techniques |
has_propaganda |
Text contains one or more propaganda techniques |
Test Set Results:
| Metric | Score |
|---|---|
| Accuracy | 99.5% |
| F1 Score | 99.6% |
| Precision | 99.2% |
| Recall | 100.0% |
| ROC AUC | 99.9% |
from transformers import pipeline
detector = pipeline(
"text-classification",
model="synapti/nci-binary-detector"
)
text = "The radical left is DESTROYING our country!"
result = detector(text)[0]
print(f"Label: {result['label']}") # 'has_propaganda' or 'no_propaganda'
print(f"Confidence: {result['score']:.2%}")
For best results, use with the technique classifier:
from transformers import pipeline
# Stage 1: Binary detection
detector = pipeline("text-classification", model="synapti/nci-binary-detector")
# Stage 2: Technique classification (only if propaganda detected)
classifier = pipeline("text-classification", model="synapti/nci-technique-classifier", top_k=None)
text = "Your text to analyze..."
# Quick check first
detection = detector(text)[0]
if detection["label"] == "has_propaganda" and detection["score"] > 0.5:
# Detailed technique analysis
techniques = classifier(text)[0]
detected = [t for t in techniques if t["score"] > 0.3]
for t in detected:
print(f"{t['label']}: {t['score']:.2%}")
else:
print("No propaganda detected")
Trained on synapti/nci-propaganda-production:
@inproceedings{da-san-martino-etal-2020-semeval,
title = "{S}em{E}val-2020 Task 11: Detection of Propaganda Techniques in News Articles",
author = "Da San Martino, Giovanni and others",
booktitle = "Proceedings of SemEval-2020",
year = "2020",
}
@misc{nci-binary-detector,
author = {NCI Protocol Team},
title = {NCI Binary Detector},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/synapti/nci-binary-detector}
}
Apache 2.0
Base model
answerdotai/ModernBERT-base