Views
No views yet
xlm-roberta-base and designed to handle Roman Urdu, code-mixed Urdu-English, and social media style text, including slang-heavy WhatsApp chats, YouTube comments, and Twitter posts.
Benchmark notebook: Kaggle
1from transformers import pipeline
2
3pipe = pipeline(
4 "text-classification",
5 model="Khubaib01/roman-urdu-sentiment-xlm-r",
6 truncation=True
7)
8
9pipe("ye banda bohot acha hai")
101from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3model_id = "Khubaib01/roman-urdu-sentiment-xlm-r"
4
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForSequenceClassification.from_pretrained(model_id)
7
8inputs = tokenizer("ye insan acha nahi lagta", return_tensors="pt")
9logits = model(**inputs).logits
10label_id = logits.argmax(dim=-1).item()
11
12id2label = {0:"Positive", 1:"Negative", 2:"Neutral"}
13print(id2label[label_id])1@misc{roman_urdu_sentiment2025,
2 title={Roman Urdu Sentiment Analysis Model},
3 author={Muhammad Khubaib Ahmad},
4 year={2025},
5 note={HuggingFace Transformers model, fine-tuned from xlm-roberta-base}
6}Muhammad Khubaib Ahmad. (2025). Roman Urdu Sentiment Analysis Model. HuggingFace Transformers. Fine-tuned from xlm-roberta-base.