This model is a fine-tuned version of xlm-roberta-base on the None dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - learningrate: 3e-05 - trainbatchsize: 16 - evalbatchsize: 16 - lrschedulertype: linear - trainingsteps: 1800 - mixedprecisiontraining: Native AMP - Transformers 4.37.2 - Pytorch 2.1.0+cu121 - Datasets 2.17.1 - Tokenizers 0.15.2
Open-weight model · Text classification
sindhi-sentiment-xlmr
by Ali Nawaz alinawazmahar/sindhi-sentiment-xlmr
sindhi-sentiment-xlmr is an open-weight model for text classification from Ali Nawaz, released under MIT License. It has 278M parameters and a 514-token context. At 16-bit it needs about 0.7 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index. It draws 16 downloads a month.
Research and education on Sindhi NLP, and as a starting point for sentiment tools on short, single-sentence Sindhi text.
Runs On
What it takes to serve sindhi-sentiment-xlmr (278M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.
| Precision | Weights | Memory needed | Cheapest setup | Per hour | Also fits |
|---|---|---|---|---|---|
| 16-bit | 0.6 GB | 0.7 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 8-bit | 0.3 GB | 0.3 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 4-bit | 0.1 GB | 0.2 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Oct 22, 2026.
sindhi-sentiment-xlmr on every accelerator the SAVRN Index prices, at every precision
Model Card
By Ali Nawaz, published under mit, revision 7665f1262b59.
Research and education on Sindhi NLP, and as a starting point for sentiment tools on short, single-sentence Sindhi text. - Input is expected to be Sindhi in Arabic script, cleaned with the project's cleantext (Unicode NFKC, invisible characters removed, whitespace normalized) before prediction. - Decisions about people (employment, credit, moderation or legal outcomes) without human review. - Text far from the training data: long documents, social-media slang or code-mixed text, other languages or other Sindhi scripts, sarcasm-heavy text. These are untested. - Measuring sentiment of a population or topic without checking accuracy on that kind of text first. Natural dataset (human-labeled).…
Read Ali Nawaz's full model card
Model card: Sindhi sentiment classifier
Model details
| Task | Sentence-level sentiment classification of Sindhi text: negative, neutral, positive |
| Main model | xlmr_mixed: xlm-roberta-base fine-tuned for sequence classification |
| Reference model | baseline_natural: TF-IDF (word 1-2 grams) + LinearSVC |
| Hugging Face | alinawazmahar/sindhi-sentiment-xlmr |
| Framework | PyTorch, Hugging Face Transformers; scikit-learn for the baseline |
| Seed | 42 |
| Author | Ali Nawaz |
| Contact | [email protected] |
| License | Model weights are free to use under the MIT License, the same license as the base model xlm-roberta-base. The natural dataset is not included. |
| Version | 0.1.0 |
Intended use
- Research and education on Sindhi NLP, and as a starting point for sentiment tools on short, single-sentence Sindhi text.
- Input is expected to be Sindhi in Arabic script, cleaned with the project's
clean_text(Unicode NFKC, invisible characters removed, whitespace normalized) before prediction.
Out-of-scope uses
- Decisions about people (employment, credit, moderation or legal outcomes) without human review.
- Text far from the training data: long documents, social-media slang or code-mixed text, other languages or other Sindhi scripts, sarcasm-heavy text. These are untested.
- Measuring sentiment of a population or topic without checking accuracy on that kind of text first.
Data
Natural dataset (human-labeled). 4,420 Sindhi sentences with three labels (1,500 negative, 1,419 neutral, 1,501 positive). Sentences are 2 to 54 words long (mean 13.3) with a vocabulary of 9,060 words. Split with a fixed seed, grouped so near-duplicates stay together: 3,094 train, 442 validation, 884 test (locked until the final evaluation). Source and labeling: the sentences were collected from Awaz and other articles and newspapers, and labeled by a single human annotator. No second annotator reviewed the labels, so agreement between annotators was not measured. A formal definition of the neutral class is not documented here. The dataset is available separately on Kaggle: https://www.kaggle.com/datasets/alinawaz06/sindhi-sentiment-analysis-dataset (check the dataset page for its terms, since the text comes from published sources).
Synthetic dataset. 150,000 machine-generated sentences (50,000 per class), split 120,000 / 15,000 / 15,000 with duplicates and weekday variants of the same sentence kept within one split. The text is built from sentence templates with a small vocabulary (about 2,400 words in the training split). It is useful for testing the pipeline but not representative of real Sindhi: a baseline trained on it scores 0.9998 on its own validation set and only 0.6002 on the natural validation set.
Training procedure (xlmr_mixed)
- Training data: up to 30,000 synthetic training sentences plus the natural training split repeated 5 times.
- Texts that also appear in a validation set were removed from training.
- Learning rate 2e-5, batch size 32, up to 3 epochs, warmup ratio 0.1, weight decay 0.01, max length 128, mixed precision (fp16).
- Checkpoint chosen by macro-F1 on the natural validation set (best epoch: 2).
- Hardware: one NVIDIA Tesla T4 on Kaggle.
- Training time and exact library versions: see
artifacts/models/xlmr_mixed/training_config.json.
The baseline was trained on the natural training split only, in under one second on CPU.
Evaluation
Scored on the natural dataset. Test results were produced once, after all choices were fixed.
| Model | Validation macro-F1 | Test macro-F1 | Test accuracy |
|---|---|---|---|
| TF-IDF + LinearSVC, trained on synthetic data | 0.6002 | not run | not run |
| TF-IDF + LinearSVC, trained on natural data | 0.8665 | 0.8695 | 0.8688 |
| XLM-RoBERTa, natural data only | 0.8663 | not run | not run |
XLM-RoBERTa, synthetic + natural (xlmr_mixed) |
0.8872 | 0.8906 | 0.8903 |
Notes:
- The test set has 884 sentences, so each accuracy carries a margin of roughly ±2 percentage points. The 0.021 macro-F1 gap between the two main models should be read with that in mind. A paired comparison (exact McNemar test, saved in
artifacts/metrics/compare_baseline_natural_vs_xlmr_mixed_external_test.json) found that on the 884 test sentences both models were right on 712 and wrong on 41. The baseline alone was wrong on 75 and XLM-R alone on 56, giving p = 0.116. The difference between the two models is therefore not statistically significant at this test size: XLM-R scored higher, but the result could plausibly be chance. When compute is limited, the lightweight baseline is a reasonable choice. - Per-class precision, recall, F1 and confusion matrices are in
artifacts/metrics/. - Scores on the synthetic validation set (0.9998 for every model) are not evidence of quality.
Limitations and risks
- Small, narrow evaluation. One human-labeled set of short sentences. Performance on other domains, longer text, or other authors is unknown.
- Label quality is unmeasured. The labels come from one annotator and were not independently reviewed, so inter-annotator agreement is unknown. Neutral is often the least well-defined class.
- Synthetic data in training. The mixed model saw templated sentences. The validation gain from adding them (0.8872 vs 0.8663 without) is small and not shown to be significant.
- Topic cues. The baseline's strongest neutral features are topic words (city, market, hospital, budget), which is consistent with news-style sources. Neutral predictions may follow topic instead of sentiment on unfamiliar subjects.
- Overfitting signs. In the mixed run, training loss fell to near zero while validation loss rose after epoch 2.
- Language variety. Behaviour on dialects, spelling variants, and transliterated Sindhi has not been tested.
License
The trained model weights in this repository are free to use, including for commercial work, under the MIT License. Please keep the author credit (Ali Nawaz). The base model, xlm-roberta-base, is also MIT licensed. The 4,420-sentence human-labeled dataset is not part of this model release and is not covered by this license; it is published separately on Kaggle (link above) under its own terms.
Ethical considerations
Sentiment labels are a coarse and subjective summary of text. Predictions can be wrong, and errors may not be evenly distributed across topics, dialects, or communities. Use human review for anything consequential. The natural dataset contains sentences taken from newspapers and articles, so check its terms before reusing or redistributing it.
How to use
With plain Transformers (no extra package needed):
from transformers import pipeline
classifier = pipeline("text-classification", model="alinawazmahar/sindhi-sentiment-xlmr")
print(classifier("اڄ جو ڏينهن تمام سٺو آهي", truncation=True, max_length=128))
The model was trained on text cleaned with Unicode NFKC normalization, removal of zero-width and bidirectional control characters and tatweel, and whitespace normalization. The Transformers pipeline does not apply this cleaning. For results that match the evaluation, use the project's sindhi-nlp package, which cleans the text for you and also returns the probability of every class:
from sindhi_nlp import SentimentPredictor
predictor = SentimentPredictor.from_pretrained("alinawazmahar/sindhi-sentiment-xlmr")
result = predictor.predict("اڄ جو ڏينهن تمام سٺو آهي")
print(result.label, result.confidence, result.probabilities)
The probabilities are overconfident (see Limitations), so use them as a ranking score rather than as calibrated probabilities. Install the package with pip install "sindhi-nlp[transformers]".
Files in this repository
| File | Purpose |
|---|---|
model.safetensors, config.json |
XLM-RoBERTa weights and architecture, with the labels negative, neutral, positive |
tokenizer.json, tokenizer_config.json |
Tokenizer |
label_mapping.json |
Label to class-id mapping |
preprocessing.json |
Text-cleaning settings used in training |
training_config.json |
Training settings, seed, data file hashes, library versions |
metrics.json |
Validation metrics |
Configuration
- Architecture
- XLMRobertaForSequenceClassification
- Context length (tokens)
- 514
- Layers
- 12
- Hidden size
- 768
- Feed-forward size
- 3,072
- Attention heads
- 12
- Vocabulary size
- 250,002
- Model type
- xlm-roberta
Identity and Version
- Repository
- alinawazmahar/sindhi-sentiment-xlmr
- Publisher
- Ali Nawaz
- Task
- Text classification
- Modality
- Text
- Library
- transformers
- Parameters
- 278M parameters
- Languages
- sd
- Revision
- 7665f1262b598880f0c04d156086118a1d7348b6
- First published
- 2026-10-13
- Last updated
- 2026-10-20
Files and Weights
10 files, 1.1 GB in total. The weights are 1 file totalling 1.1 GB in safetensors.
Every file
| File | Type | Size | SHA-256 |
|---|---|---|---|
| model.safetensors | Weights | 1.1 GB | 667fa5c60ebb |
| config.json | Configuration | 970 B | — |
| label_mapping.json | Configuration | 53 B | — |
| metrics.json | Configuration | 2.5 KB | — |
| preprocessing.json | Configuration | 233 B | — |
| training_config.json | Configuration | 2.1 KB | — |
| README.md | Documentation | 8.6 KB | — |
| .gitattributes | Repository | 1.6 KB | — |
| tokenizer.json | Tokenizer | 17.1 MB | 2687cc191964 |
| tokenizer_config.json | Tokenizer | 343 B | — |
License and Download
- License
- mit
- Access
- Open weights, no gate
- Download size
- 1.1 GB
Released by Ali Nawaz through its official repository on Hugging Face. Read the license.
Built From
- Derived from FacebookAI/xlm-roberta-base
Memory Requirements
| Precision | Weights in memory |
|---|---|
| As published | 1.1 GB |
| 16-bit | 0.6 GB |
| 8-bit | 0.3 GB |
| 4-bit | 0.1 GB |
Weights only, from the published parameter count; the key-value cache and runtime add to this.
Questions About sindhi-sentiment-xlmr
How much GPU memory does sindhi-sentiment-xlmr need?
About 0.7 GB at 16-bit and 0.2 GB at 4-bit: the weights (278M parameters) plus a working margin. A long context needs more.
What is the cheapest GPU to run sindhi-sentiment-xlmr on?
At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.
Can I use sindhi-sentiment-xlmr commercially?
Yes. sindhi-sentiment-xlmr is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.
What is sindhi-sentiment-xlmr's context length?
514 tokens, from the maximum position embeddings in its published configuration.
Similar Models
This repository contains a fine-tuned XLM-RoBERTa Base model for 3-class sentiment classification in Sindhi. The model predicts one of the following labels: - positive - neutral - negative This model is intended for research, experimentation, and lightweight production prototyping on Sindhi-language sentiment analysis tasks. It may be useful for short-text classification such as reviews, feedback, and social-media snippets. It should not be used as the only basis for high-stakes decisions. Performance can vary by domain, dialect, and writing style, and human review is recommended when errors could affect people or organizations. The saved model artifacts in this repository report the…
We have updated the new reranker, supporting larger lengths, more languages, and achieving better performance. More details please refer to our Github: FlagEmbedding. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 3/18/2024: Release new rerankers, built upon powerful M3 and LLM (GEMMA and MiniCPM, not so large actually) backbones, supporitng multi-lingual processing and larger inputs, massive improvements of ranking performances on BEIR, C-MTEB/Retrieval, MIRACL, LlamaIndex Evaluation. - 3/18/2024: Release Visualized-BGE, equipping BGE with visual capabilities. Visualized-BGE can be utilized to generate embeddings for hybrid image-text…
A sequence classification model fine-tuned on top of ai4bharat/IndicBERTv2-MLM-only to detect fraudulent, phishing, and scam messages across 14 Indian languages and language varieties. The model is designed with a focus on lightweight multilingual scam detection for Indian communications and common fraud patterns. This model is intended to detect common fraud and scam patterns prevalent across Indian communications, including: - Electricity and utility disconnection threats. - Impersonation of major institutions such as banks, India Post, and courier services. - Fake lottery, subsidy, and government-scheme claims. - Suspicious payment requests and fee demands. - Phishing and malicious…
A sequence classification model fine-tuned on top of ai4bharat/IndicBERTv2-MLM-only to detect fraudulent, phishing, and scam messages across 14 Indian languages and language varieties[cite: 4]. This v2 model represents a significant upgrade over the baseline v1 iteration, leveraging advanced entity masking and continuous feedback loop training on a T4 GPU to heavily reduce False Negatives (scam $ightarrow$ ham misclassifications). The original v1 baseline achieved a highly respectable 98.29% accuracy but exhibited vulnerabilities to specific scam evasion tactics (e.g., protocol obfuscation like hxxp://, naked domains, and specific tele-fraud requests)[cite: 4]. To resolve this, v2 was…
This is v1, the shipped model (branch main): a 12-class intent classifier for logistics chat messages, fine-tuned from intfloat/multilingual-e5-base, with an optional abstention flag for messages unlike the training data. A robustness variant (v3) is on branch robust-v3. Model fingerprint (sha256 of fp32 state dict): 7ca22e16d2ace345d9dcf7737887e85fedf400a1dfc863678c2fc2663bf102bd Abstention (the out-of-distribution flag) is NOT part of the plain model: it needs predict.py and oodbank.safetensors from the same repository, used as follows. Confidences are temperature-scaled (T = 1.0228); messages whose Mahalanobis score falls below the threshold (-128.06 v1 / -178.56 v3; this model's…