Text Generation
Transformers
Safetensors
Arabic
English
qwen2
propaganda-detection
persuasion-techniques
span-identification
explainability
lora
conversational
text-generation-inference
Instructions to use QCRI/ProBel-MTL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QCRI/ProBel-MTL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QCRI/ProBel-MTL") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("QCRI/ProBel-MTL") model = AutoModelForCausalLM.from_pretrained("QCRI/ProBel-MTL", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QCRI/ProBel-MTL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QCRI/ProBel-MTL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QCRI/ProBel-MTL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QCRI/ProBel-MTL
- SGLang
How to use QCRI/ProBel-MTL with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "QCRI/ProBel-MTL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QCRI/ProBel-MTL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "QCRI/ProBel-MTL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QCRI/ProBel-MTL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QCRI/ProBel-MTL with Docker Model Runner:
docker model run hf.co/QCRI/ProBel-MTL
model card + prompt template
Browse files- README.md +141 -1
- binary_prompt_en.txt +31 -0
README.md
CHANGED
|
@@ -1,3 +1,143 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 4 |
+
language:
|
| 5 |
+
- ar
|
| 6 |
+
- en
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
library_name: transformers
|
| 9 |
+
datasets:
|
| 10 |
+
- QCRI/ProBel
|
| 11 |
+
tags:
|
| 12 |
+
- propaganda-detection
|
| 13 |
+
- persuasion-techniques
|
| 14 |
+
- span-identification
|
| 15 |
+
- explainability
|
| 16 |
+
- lora
|
| 17 |
---
|
| 18 |
+
|
| 19 |
+
# ProBel-MTL
|
| 20 |
+
|
| 21 |
+
The bilingual multi-task model from the ProBel paper (Mt-SFT): a single
|
| 22 |
+
Qwen2.5-7B-Instruct fine-tune that handles all five ProBel tasks in both Arabic
|
| 23 |
+
and English — binary propaganda detection, coarse-category and fine-grained
|
| 24 |
+
technique classification (with explanations), and technique-labeled span
|
| 25 |
+
extraction in two output formats.
|
| 26 |
+
|
| 27 |
+
Trained with LoRA (r=16, alpha=32) on the Arabic and English training splits of
|
| 28 |
+
[QCRI/ProBel](https://huggingface.co/datasets/QCRI/ProBel) across all five task
|
| 29 |
+
formats jointly; the checkpoint was selected on validation loss and merged into
|
| 30 |
+
the base model, so it loads as a regular causal LM. The LoRA adapter alone is in
|
| 31 |
+
`lora_adapter/`.
|
| 32 |
+
|
| 33 |
+
Companion resources: [dataset](https://huggingface.co/datasets/QCRI/ProBel) ·
|
| 34 |
+
[code](https://github.com/MohamedBayan/ProBel) · paper: *ProBel: Propaganda
|
| 35 |
+
Detection with Techniques, Spans, and Explanations* (PDF in the code
|
| 36 |
+
repository; arXiv link will be added once available).
|
| 37 |
+
|
| 38 |
+
## Test scores
|
| 39 |
+
|
| 40 |
+
| | Binary | Coarse | Technique | Span-tag | Span-occ |
|
| 41 |
+
|---|---|---|---|---|---|
|
| 42 |
+
| Arabic | 0.763 | 0.682 | 0.575 | 0.411 | 0.362 |
|
| 43 |
+
| English | 0.735 | 0.410 | 0.272 | 0.189 | 0.241 |
|
| 44 |
+
|
| 45 |
+
Binary is macro-F1; coarse/technique are micro-F1; spans use the
|
| 46 |
+
overlap-adjusted micro-F1 of Da San Martino et al. (2020). These match the
|
| 47 |
+
paper's Mt-SFT rows and were produced with greedy decoding.
|
| 48 |
+
|
| 49 |
+
## Usage
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 53 |
+
|
| 54 |
+
model = AutoModelForCausalLM.from_pretrained("QCRI/ProBel-MTL",
|
| 55 |
+
torch_dtype="bfloat16",
|
| 56 |
+
device_map="auto")
|
| 57 |
+
tok = AutoTokenizer.from_pretrained("QCRI/ProBel-MTL")
|
| 58 |
+
|
| 59 |
+
system = ("You are an expert in media analysis and propaganda detection, "
|
| 60 |
+
"specialized in English text. You analyze texts to determine whether "
|
| 61 |
+
"they contain propaganda techniques and provide clear, evidence-based "
|
| 62 |
+
"explanations for your assessments.")
|
| 63 |
+
user = open("binary_prompt_en.txt").read().replace(
|
| 64 |
+
"{TEXT}", "Even sadder, however, is the fact that these smear campaigns "
|
| 65 |
+
"work most of the time.")
|
| 66 |
+
|
| 67 |
+
ids = tok.apply_chat_template(
|
| 68 |
+
[{"role": "system", "content": system}, {"role": "user", "content": user}],
|
| 69 |
+
add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 70 |
+
out = model.generate(ids, max_new_tokens=512, do_sample=False)
|
| 71 |
+
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
|
| 72 |
+
# Label: false
|
| 73 |
+
# Explanation: ...
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
The model also serves directly with vLLM (`vllm serve QCRI/ProBel-MTL`).
|
| 77 |
+
|
| 78 |
+
## Instruction format
|
| 79 |
+
|
| 80 |
+
The model expects the exact task prompts it was trained on. The full templates
|
| 81 |
+
for all five tasks and both languages ship with the
|
| 82 |
+
[dataset conversion scripts](https://github.com/MohamedBayan/ProBel)
|
| 83 |
+
(`src/ms_swift/prepare_data.py`); the binary English prompt looks like this
|
| 84 |
+
(`{TEXT}` is the input sentence):
|
| 85 |
+
|
| 86 |
+
```
|
| 87 |
+
Analyze the following text and determine whether it contains propaganda techniques.
|
| 88 |
+
|
| 89 |
+
Propaganda techniques include manipulative language strategies such as:
|
| 90 |
+
- Loaded_Language: emotionally charged words to influence perception
|
| 91 |
+
- Name_Calling-Labeling: attaching negative labels to dismiss someone
|
| 92 |
+
[...technique glossary...]
|
| 93 |
+
|
| 94 |
+
Respond EXACTLY in this format (in English):
|
| 95 |
+
Label: true
|
| 96 |
+
Explanation: <your explanation of why this text is or is not propagandistic>
|
| 97 |
+
|
| 98 |
+
OR
|
| 99 |
+
|
| 100 |
+
Label: false
|
| 101 |
+
Explanation: <your explanation>
|
| 102 |
+
|
| 103 |
+
Notes:
|
| 104 |
+
- Use "true" if the text contains ANY propaganda technique, "false" otherwise.
|
| 105 |
+
- The Label MUST be exactly "true" or "false" (lowercase).
|
| 106 |
+
- The Explanation should identify which specific techniques are used (if any) and why.
|
| 107 |
+
- Analyze the text objectively, considering the language, framing, and intent.
|
| 108 |
+
|
| 109 |
+
Text: "{TEXT}"
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
Output formats per task:
|
| 113 |
+
|
| 114 |
+
| Task | Output |
|
| 115 |
+
|---|---|
|
| 116 |
+
| binary | `Label: true\|false` + `Explanation: ...` |
|
| 117 |
+
| coarse / technique | `Labels: <comma-separated or none>` + `Explanation: ...` |
|
| 118 |
+
| span-tag | the input sentence with inline `<span type="Technique">...</span>` tags |
|
| 119 |
+
| span-occ | a JSON list of `{"text", "label", "occurrence"}` objects |
|
| 120 |
+
|
| 121 |
+
Arabic inputs use Arabic prompt variants of the same structure and answer in
|
| 122 |
+
Arabic.
|
| 123 |
+
|
| 124 |
+
## Intended use and limitations
|
| 125 |
+
|
| 126 |
+
Built for research on propaganda and persuasion-technique analysis in news and
|
| 127 |
+
social-media text. Predictions are imperfect, technique performance follows the
|
| 128 |
+
long-tailed label distribution (rare techniques are often missed), and outputs
|
| 129 |
+
should support trained human reviewers rather than replace them, particularly
|
| 130 |
+
in moderation or policy settings.
|
| 131 |
+
|
| 132 |
+
## Citation
|
| 133 |
+
|
| 134 |
+
```bibtex
|
| 135 |
+
@article{hasanain2026probel,
|
| 136 |
+
title = {ProBel: Propaganda Detection with Techniques, Spans, and Explanations},
|
| 137 |
+
author = {Hasanain, Maram and Hasan, Md Arid and Kmainasi, Mohamed Bayan and
|
| 138 |
+
Sartori, Elisa and Shahroor, Ali Ezzat and Da San Martino, Giovanni
|
| 139 |
+
and Alam, Firoj},
|
| 140 |
+
year = {2026},
|
| 141 |
+
note = {Preprint. This entry will be updated upon publication.}
|
| 142 |
+
}
|
| 143 |
+
```
|
binary_prompt_en.txt
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Analyze the following text and determine whether it contains propaganda techniques.
|
| 2 |
+
|
| 3 |
+
Propaganda techniques include manipulative language strategies such as:
|
| 4 |
+
- Loaded_Language: emotionally charged words to influence perception
|
| 5 |
+
- Name_Calling-Labeling: attaching negative labels to dismiss someone
|
| 6 |
+
- Exaggeration-Minimisation: inflating or downplaying the significance of facts
|
| 7 |
+
- Appeal_to_Fear-Prejudice: exploiting fears or prejudices
|
| 8 |
+
- Causal_Oversimplification: reducing complex issues to simple cause-and-effect
|
| 9 |
+
- Flag_Waving: exploiting national or patriotic sentiments
|
| 10 |
+
- Questioning_the_Reputation: attacking credibility without evidence
|
| 11 |
+
- Doubt: raising questions without providing solid evidence
|
| 12 |
+
- Appeal_to_Authority: citing authority figures to bolster claims
|
| 13 |
+
- Slogans: using catchy, brief phrases to simplify complex issues
|
| 14 |
+
- And other techniques that aim to manipulate the audience's opinion
|
| 15 |
+
|
| 16 |
+
Respond EXACTLY in this format (in English):
|
| 17 |
+
Label: true
|
| 18 |
+
Explanation: <your explanation of why this text is or is not propagandistic>
|
| 19 |
+
|
| 20 |
+
OR
|
| 21 |
+
|
| 22 |
+
Label: false
|
| 23 |
+
Explanation: <your explanation>
|
| 24 |
+
|
| 25 |
+
Notes:
|
| 26 |
+
- Use "true" if the text contains ANY propaganda technique, "false" otherwise.
|
| 27 |
+
- The Label MUST be exactly "true" or "false" (lowercase).
|
| 28 |
+
- The Explanation should identify which specific techniques are used (if any) and why.
|
| 29 |
+
- Analyze the text objectively, considering the language, framing, and intent.
|
| 30 |
+
|
| 31 |
+
Text: "{TEXT}"
|