Views
No views yet
| Field | Value |
|---|---|
| Base model | Khubaib01/roman-urdu-sentiment-xlm-r |
| Task | Multi-class emotion classification |
| Language | Roman Urdu (Romanized Urdu / code-switched) |
| Classes | 7 (anger, disgust, fear, joy, sadness, surprise, none) |
| Parameters | ~278M (XLM-R base + custom head) |
| Max input length | 128 tokens |
| Label | Ekman Emotion |
|---|---|
| anger | Basic |
| disgust | Basic |
| fear | Basic |
| joy | Basic |
| sadness | Basic |
| surprise | Basic |
| none | No emotion |
| Metric | Score |
|---|---|
| Macro F1 | 0.7149 |
| Accuracy | 0.7148 |
| Emotion | F1 Score |
|---|---|
| Anger | 0.5962 |
| Disgust | 0.5672 |
| Fear | 0.8467 |
| Happy | 0.7276 |
| Sad | 0.6379 |
| Surprise | 0.9349 |
| None | 0.6937 |
Input (Roman Urdu text)
→ XLM-R Tokenizer (max_length=128)
→ XLM-R Encoder (12 layers, hidden=768)
→ [CLS] token representation
→ LayerNorm → Dropout(0.3)
→ Linear(768 → 256) → GELU → Dropout(0.15)
→ Linear(256 → 7)
→ CrossEntropyLoss (label_smoothing=0.1)| Hyperparameter | Value |
|---|---|
| Base LR (encoder) | 2e-5 |
| Head LR | 1e-4 |
| Layer-wise LR decay | 0.95 per layer |
| Scheduler | Cosine with 10% warm-up |
| Epochs | Up to 10 (early stopping) |
| Batch size | 16 |
| Label smoothing | 0.1 |
| Dropout | 0.3 |
| Optimizer | AdamW |
| Mixed precision | fp16 |
nn.Module, not a standard HuggingFace
PreTrainedModel. You must define the class before loading weights.1from transformers import pipeline
2
3HF_REPO_ID = "Khubaib01/roman-urdu-emotion-xlmr"
4
5pipe = pipeline(
6 "text-classification",
7 model="f{HF_REPO_ID}",
8 trust_remote_code=True,
9 top_k=None,
10 )
11pipe("bhai ab mera kia hoga")1@misc{roman-urdu-emotion-xlmr,
2 author = {Muhammad Khubaib Ahmad},
3 title = {Roman Urdu Emotion Classifier (XLM-R)},
4 year = {2026},
5 publisher = {HuggingFace},
6 url = {https://huggingface.co/Khubaib01/roman-urdu-emotion-xlmr}
7}