File size: 1,834 Bytes
a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 a4b7a9b 9098742 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | ---
language:
- ur
license: apache-2.0
tags:
- text-classification
- sentiment-analysis
- urdu
- bert
- fine-tuned
- nlp
datasets:
- mirfan899/imdb_urdu_reviews
metrics:
- accuracy
- f1
model-index:
- name: urdu-sentiment-classifier
results:
- task:
type: text-classification
dataset:
name: IMDB Urdu Reviews
type: mirfan899/imdb_urdu_reviews
metrics:
- type: accuracy
value: 0.81
- type: f1
value: 0.8098
---
# Urdu Sentiment Classifier 🇵🇰
A fine-tuned **bert-base-multilingual-cased** model for **Urdu sentiment analysis** — classifying Urdu text as positive or negative.
## Live Demo
[Try it on HuggingFace Spaces](https://huggingface.co/spaces/H-Layba/urdu-sentiment-classifier)
## Performance
| Metric | Score |
|--------|-------|
| Accuracy | 81.00% |
| F1 Score (weighted) | 0.8098 |
## Example Predictions
```python
from transformers import pipeline
classifier = pipeline("text-classification", model="H-Layba/urdu-sentiment-classifier")
classifier("یہ فلم بہت اچھی تھی")
# [{'label': 'positive', 'score': 0.9936}]
classifier("آج کا دن بہت برا تھا")
# [{'label': 'negative', 'score': 0.9918}]
```
## Training Details
- **Base model:** bert-base-multilingual-cased
- **Dataset:** 50,000 Urdu movie reviews
- **Epochs:** 5
- **Learning rate:** 2e-5
- **Batch size:** 32 (train), 64 (eval)
- **Hardware:** Kaggle T4 GPU
- **Mixed precision:** fp16
## Dataset
Trained on `mirfan899/imdb_urdu_reviews` — 50,000 Urdu translations of IMDB movie reviews with positive/negative sentiment labels.
## Part of Urdu NLP Suite
This model is part of a larger collection of fine-tuned Urdu NLP models:
- [x] Sentiment Classification ← this model
- [ ] Text Summarization
- [ ] Question Answering
- [ ] Urdu → English Translation |