CoolFace
Modelpublic

DanishMahdi/snd_movie_sentiment_analysis

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes10downloads
Model Card

๐ŸŽฌ Sindhi Movie Sentiment Analysis

Fine-tuned XLM-RoBERTa-base model for binary sentiment classification on Sindhi movie reviews.


๐Ÿ“‹ Model Details

FieldDetails
Base modelxlm-roberta-base
TaskBinary Sentiment Classification
LanguageSindhi (sd) โ€” Perso-Arabic / Nastaliq script
Labelspositive ยท negative
DatasetDanishMahdi/snd_movies_sentiment_analysis
Training rows~40,000 (20k positive, 20k negative)
Max token length128

๐Ÿ“Š Training Configuration

HyperparameterValue
Learning rate2e-5
Batch size16
Epochs5 (early stopping patience = 2)
Warmup ratio0.1
LR schedulercosine
Weight decay0.01
OptimizerAdamW
Precisionfp16 (if CUDA available)

๐Ÿš€ Quick Start

Install dependencies

bash
pip install transformers torch

Run inference

python
from transformers import pipeline

pipe = pipeline(
    "text-classification",
    model="DanishMahdi/snd_sentiment_analysis",
)

reviews = [
    "ู‡ูŠ ูู„ู… ุจู„ฺชู„ ุฎุฑุงุจ ู‡ุฆูŠุŒ ู…ูˆู† ฺฉูŠ ูพุณู†ุฏ ู†ู‡ ุขุฆูŠ",   # negative
    "ู‡ูŠ ูู„ู… ุชู…ุงู… ุณูบูŠ ู‡ุฆูŠุŒ ู…ูˆู† ฺฉูŠ ุชู…ุงู… ฺฏู‡ฺปูˆ ูพุณู†ุฏ ุขุฆูŠ",  # positive
]

for review in reviews:
    result = pipe(review)[0]
    print(f"Label: {result['label']} | Score: {result['score']:.4f}")

Output

Label: NEGATIVE | Score: 0.9873
Label: POSITIVE | Score: 0.9912

๐Ÿ“ Repository Structure

DanishMahdi/snd_sentiment_analysis/
โ”œโ”€โ”€ config.json                    # Model config
โ”œโ”€โ”€ model.safetensors              # Fine-tuned weights
โ”œโ”€โ”€ tokenizer_config.json          # Tokenizer config
โ”œโ”€โ”€ sentencepiece.bpe.model        # SentencePiece vocab
โ”œโ”€โ”€ evaluation/
โ”‚   โ”œโ”€โ”€ test_metrics.json          # Accuracy, F1, Precision, Recall
โ”‚   โ”œโ”€โ”€ confusion_matrix.json      # Raw confusion matrix
โ”‚   โ”œโ”€โ”€ confusion_matrix.png       # Confusion matrix plot
โ”‚   โ”œโ”€โ”€ training_curves.png        # Loss & F1 over epochs
โ”‚   โ”œโ”€โ”€ test_metrics_bar.png       # Bar chart of metrics
โ”‚   โ””โ”€โ”€ classification_report.txt  # Full sklearn report
โ””โ”€โ”€ README.md

๐Ÿ“ˆ Evaluation Results

See evaluation/test_metrics.json for the latest numbers. Plots are available in the evaluation/ folder.

MetricScore
Accuracy0.8825
F1 (weighted)0.8825
Precision (weighted)0.8828
Recall (weighted)0.8825

๐Ÿ”— Dataset

The training data is sourced from `DanishMahdi/snd_movies_sentiment_analysis`

  • โ€”Total rows: ~40,000
  • โ€”Positive reviews: ~20,000
  • โ€”Negative reviews: ~20,000
  • โ€”Split: 80% train / 10% validation / 10% test

๐Ÿ“ Citation

bibtex
@misc{danish2025snd,
  author    = {Danish Mahdi},
  title     = {Sindhi Movie Sentiment Analysis using XLM-RoBERTa},
  year      = {2026},
  publisher = {Hugging Face},
  url       = {https://huggingface.co/DanishMahdi/snd_sentiment_analysis},
}

โš–๏ธ License

MIT โ€” free to use for research and commercial purposes.