Downloads · 30 days
9
12% of all-time downloads
Nikki3241/roman-urdu-sentiment-distilbert
roman-urdu-sentiment-distilbert is a text classification model from Nikki3241. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
A fine-tuned DistilBERT model that classifies Roman Urdu text (Urdu written in Latin script) into three sentiment categories: Positive, Negative, or Neutral.
Downloads · 30 days
9
12% of all-time downloads
All-time downloads
73
Public
Parameters
67M
268 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
A fine-tuned DistilBERT model that classifies Roman Urdu text (Urdu written in Latin script) into three sentiment categories: Positive, Negative, or Neutral.
This model fine-tunes distilbert-base-uncased on a dataset of Roman Urdu sentences to perform sentiment classification. Roman Urdu presents unique NLP challenges due to inconsistent spelling, informal grammar, and lack of standardized script — making sentiment analysis on it a genuinely hard task compared to standard English NLP.
| Metric | Score |
|---|---|
| Accuracy | 66.0% |
| F1 (weighted) | 66.0% |
| Class | Precision | Recall | F1-score |
|---|---|---|---|
| Positive | 0.63 | 0.64 | 0.63 |
| Negative | 0.60 | 0.59 | 0.60 |
| Neutral | 0.71 | 0.72 | 0.72 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/roman-urdu-sentiment-distilbert")
model = AutoModelForSequenceClassification.from_pretrained("YOUR_USERNAME/roman-urdu-sentiment-distilbert")
text = "yeh bohat acha hai"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=64)
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1).item()
labels = ["Positive", "Negative", "Neutral"]
print(labels[prediction])
Fine-tuned by Nusrat as part of an applied NLP/LLM portfolio project.