Instructions to use fatemamojibor/propaganda-ner-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fatemamojibor/propaganda-ner-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="fatemamojibor/propaganda-ner-model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("fatemamojibor/propaganda-ner-model") model = AutoModelForTokenClassification.from_pretrained("fatemamojibor/propaganda-ner-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model Card for Model ID
from transformers import AutoTokenizer, AutoModelForSequenceClassification
Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("fatemamojibor/propaganda-ner-model") model = AutoModelForSequenceClassification.from_pretrained("fatemamojibor/propaganda-ner-model")
Example input text
text = "إن زعيمنا وحده هو القادر على إنقاذ الأمة من الكارثة التي تسبب فيها الغرباء. ويتعين على كل الوطنيين الحقيقيين أن يتبعوا قراراته ويدعموها دون أدنى شك من أجل استعادة عظمة بلادنا."
Tokenize the text
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=512)
Perform forward pass to get model output
outputs = model(**inputs)
Get the predicted class
logits = outputs.logits predicted_class = logits.argmax(dim=-1).item() print(f"Predicted class: {predicted_class}")
Direct Use
Use directly: the label is encoded as: {'O': 0, 'Appeal_to_Values': 1, 'Loaded_Language': 2, 'Consequential_Oversimplification': 3, 'Causal_Oversimplification': 4, 'Questioning_the_Reputation': 5, 'Straw_Man': 6, 'Repetition': 7, 'Guilt_by_Association': 8, 'Appeal_to_Hypocrisy': 9, 'Conversation_Killer': 10, 'False_Dilemma-No_Choice': 11, 'Whataboutism': 12, 'Slogans': 13, 'Obfuscation-Vagueness-Confusion': 14, 'Name_Calling-Labeling': 15, 'Flag_Waving': 16, 'Doubt': 17, 'Appeal_to_Fear-Prejudice': 18, 'Exaggeration-Minimisation': 19, 'Red_Herring': 20, 'Appeal_to_Popularity': 21, 'Appeal_to_Authority': 22, 'Appeal_to_Time': 23} {0: 'O', 1: 'Appeal_to_Values', 2: 'Loaded_Language', 3: 'Consequential_Oversimplification', 4: 'Causal_Oversimplification', 5: 'Questioning_the_Reputation', 6: 'Straw_Man', 7: 'Repetition', 8: 'Guilt_by_Association', 9: 'Appeal_to_Hypocrisy', 10: 'Conversation_Killer', 11: 'False_Dilemma-No_Choice', 12: 'Whataboutism', 13: 'Slogans', 14: 'Obfuscation-Vagueness-Confusion', 15: 'Name_Calling-Labeling', 16: 'Flag_Waving', 17: 'Doubt', 18: 'Appeal_to_Fear-Prejudice', 19: 'Exaggeration-Minimisation', 20: 'Red_Herring', 21: 'Appeal_to_Popularity', 22: 'Appeal_to_Authority', 23: 'Appeal_to_Time'}
Training Data
https://github.com/rafiulbiswas/ArAIEval_ArabicNLP24_Task_1
Given a multigenre text snippet (a news paragraph or a tweet), the task is to detect the propaganda techniques used in the text together with the exact span(s) in which each propaganda technique appears. This a sequence tagging task.
Citation [optional]
BibTeX:
@inproceedings{biswas-etal-2024-mememind, title = "{M}eme{M}ind at {A}r{AIE}val Shared Task: Spotting Persuasive Spans in {A}rabic Text with Persuasion Techniques Identification", author = "Biswas, Md. Rafiul and Shah, Zubair and Zaghouani, Wajdi", booktitle = "Proceedings of The Second Arabic Natural Language Processing Conference", month = aug, year = "2024", address = "Bangkok, Thailand", publisher = "Association for Computational Linguistics", url = "https://aclanthology.org/2024.arabicnlp-1.50", pages = "494--500", }
Model Card Contact
[More Information Needed]
- Downloads last month
- 4