Downloads · 30 days
7
14% of all-time downloads
RutPatel/Qwen2.5-0.5B-India-Propaganda-Detector
Qwen2.5-0.5B-India-Propaganda-Detector is a text generation model from RutPatel. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A QLoRA fine-tuned version of Qwen/Qwen2.5-0.5B, trained to detect anti-India propaganda in text.
Downloads · 30 days
7
14% of all-time downloads
All-time downloads
50
Public
Repo size
15.8 MB
Likes
0
Public
Click a slice to open those files.
.json11.4 MB · 72%
From the Hugging Face model README
A QLoRA fine-tuned version of Qwen/Qwen2.5-0.5B, trained to detect anti-India propaganda in text.
This model classifies text as either PROPAGANDA or NOT_PROPAGANDA and provides:
It distinguishes between genuine anti-India propaganda (misinformation, manipulated narratives) and legitimate criticism, balanced reporting, or academic analysis.
| Category | Description |
|---|---|
| Territorial Integrity | False claims about Kashmir, Arunachal Pradesh, borders |
| Religious Division | Content inciting communal hatred and exaggerating tensions |
| Economic Misinformation | Distorted facts about India's economy and development |
| Historical Revisionism | Distorting Indian history and civilization |
| Geopolitical Undermining | Narratives to weaken India's global standing |
| Military/Security FUD | Exaggerated threat narratives, false military claims |
| Separatist Propaganda | Content promoting balkanization of India |
| Democratic Institution Attacks | Undermining trust in democracy, judiciary, elections |
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-0.5B |
| Method | QLoRA (4-bit NF4 + LoRA) |
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| Target Modules | q_proj, k_proj, v_proj, o_proj |
| Training Samples | ~86 curated examples |
| Epochs | 5 |
| Learning Rate | 2e-4 (cosine schedule) |
| Optimizer | paged_adamw_8bit |
| Max Seq Length | 512 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
# Load model
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-0.5B",
quantization_config=bnb_config,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "ProfRutPatel/Qwen2.5-0.5B-India-Propaganda-Detector")
tokenizer = AutoTokenizer.from_pretrained("ProfRutPatel/Qwen2.5-0.5B-India-Propaganda-Detector")
# Analyze text
system_prompt = "You are an expert analyst specialized in detecting anti-India propaganda..."
text = "Your text to analyze here"
prompt = f"<|im_start|>system\n{system_prompt}<|im_end|>\n<|im_start|>user\nAnalyze the following text for anti-India propaganda:\n\n\"{text}\"<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.1)
result = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(result)