Views
No views yet
| Class | Original Score | Meaning |
|---|---|---|
normal | 1–2 | Clean or mildly offensive |
moderate | 3 | Clearly harmful |
severe | 4–5 | Incites action or extreme violence |
| Class | Precision | Recall | F1 |
|---|---|---|---|
| Normal (1–2) | 0.94 | 0.87 | 0.90 |
| Moderate (3) | 0.25 | 0.27 | 0.26 |
| Severe (4–5) | 0.86 | 0.91 | 0.88 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_id = "biraj-bhusal/rakshak-severity-v2"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForSequenceClassification.from_pretrained(model_id)
7
8id2label = {0: "normal", 1: "moderate", 2: "severe"}
9
10# Append detected labels from rakshak-xlmr-large-v2 to the text
11text = "your nepali text here [DETECTED: hate_speech, casteism]"
12inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
13
14with torch.no_grad():
15 logits = model(**inputs).logits
16 prediction = torch.argmax(logits, dim=-1).item()
17
18print(id2label[prediction])1@misc{bhusal2025rakshak,
2 author = {Bhusal, Biraj},
3 title = {RakshakAI: Multi-Label Toxicity Detection for Low-Resource Nepali Social Media Content},
4 year = {2025},
5 publisher = {Zenodo},
6 url = {https://zenodo.org/records/20850923}
7}