Downloads · 30 days
6
11% of all-time downloads
abd12-tahir/urdu-sentiment-model
urdu-sentiment-model is a machine learning model from abd12-tahir. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model performs sentiment analysis on Urdu text using a fine‑tuned XLM-RoBERTa transformer model.
Downloads · 30 days
6
11% of all-time downloads
All-time downloads
57
Public
Parameters
278M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 99%
From the Hugging Face model README
This model performs sentiment analysis on Urdu text using a fine‑tuned XLM-RoBERTa transformer model.
It classifies input text into:
✅ Positive
❌ Negative
⚖️ Neutral
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "abd12-tahir/urdu-sentiment-model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "میں آج بہت خوش ہوں"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
pred = torch.argmax(outputs.logits, dim=1)
print(pred)