26 · Text analytics · Open weights
The writer's own sentiment, in 13 languages.
cbx-indim-sentiment-classifier-32M
Reads the writer's own sentiment in 12 Indian languages and English: positive, negative or neutral.
Real inputs it was built for.
Not in the hosted Playground yet. Run it from the open weights on Hugging Face.
Hindi
फ़ोन की बैटरी बहुत अच्छी है, पूरा दिन चलती है।
Telugu
డెలివరీ చాలా ఆలస్యమైంది, ప్యాకింగ్ కూడా బాగాలేదు.
Benchmark
Measured against the alternative.
- cbx-indim-sentiment-classifier-32M0.822
- IndicBERT v2 (278M)0.944
- mmBERT-base (307M)0.901
- mmBERT-small (140M)0.839
From the model card
A sentiment classifier for 12 Indian languages and English: Hindi, Bengali, Marathi, Tamil, Telugu, Kannada, Malayalam, Gujarati, Punjabi, Odia, Assamese, Urdu and English, in native script, romanized or code-mixed. Give it a comment, review, post or sentence and it returns positive, negative or neutral: the writer's own sentiment. It is InDIM-small (32M) fine-tuned for sentiment, and runs in a few milliseconds on a CPU.
Full results. Every number, from the card.
Two test sets labelled by people (not used in training). Every model was fine-tuned with the same recipe and data (plain fine-tuning, learning rate picked on validation); mean of 3 training runs ± SD unless marked.
- IndicSentiment (AI4Bharat, CC0): 12,946 product reviews in 13 languages, each positive or negative. Scored by comparing the
positiveandnegativescores only (two-way accuracy). - Source-labelled test: 8,712 texts with their datasets' own labels: Telugu sentences (6,796), English tweets (870) and romanized Hindi YouTube comments (1,046). Their labelling rules differ from ours, so every model scores near 0.5 macro F1; read it for the order between models.
| Model | Parameters | IndicSentiment accuracy | Source-labelled macro F1 | English tweets | Romanized Hindi | Telugu |
|---|---|---|---|---|---|---|
| InDIM-small (this model's base) | 32M | 0.822 ± 0.016 | 0.512 ± 0.005 | 0.640 | 0.560 | 0.443 |
| mmBERT-small | 140M | 0.839 ± 0.004 | 0.508 ± 0.015 | 0.706 | 0.565 | 0.415 |
| mmBERT-base (1 run) | 307M | 0.901 | 0.524 | 0.716 | 0.601 | 0.421 |
| IndicBERT v2 | 278M | 0.944 ± 0.003 | 0.547 ± 0.002 | 0.713 | 0.577 | 0.475 |
(The last three columns are macro F1 within each source.)
- This repository holds the training run with the best validation score: IndicSentiment 0.811, source-labelled 0.518.
- InDIM-small is level with mmBERT-small at a quarter of its size and better on Telugu; the larger models, especially IndicBERT v2, are clearly better on IndicSentiment. Its weakest languages there are English, Hindi and Urdu.
CPU latency (Intel i7-10700, 8 threads, one text at a time, PyTorch fp32): 5.7 ms for a 15-token sentence, 22.8 ms for a long (about 200-word) input.
Precision: fp16 gives the same labels as fp32 on both test sets. PyTorch dynamic int8 (per-channel) keeps 95–97% of labels unchanged; ONNX int8 changed 4% of decisions in our test, so only the fp32 ONNX file is provided.
Know its limits. Before you ship it.
Limitations
- Too many opinions are called neutral. On IndicSentiment, where every review is positive or negative, a three-way decision often says
neutral. Comparepositiveandnegativeonly if your texts always carry an opinion. - Training labels come from LLMs, following a written guide, not from people; data labelled under different rules (for example, reported news as negative) will score lower.
- Context: sarcasm, irony, quotes and replies to content the model cannot see are often misread.
- Bias: errors are not spread evenly across languages, scripts, dialects or topics; political, religious and community-related text may be judged less accurately.
Training data
What it learned from.
InDIM-small (32M) fine-tuned on about 63,000 texts in 13 languages (social-media comments, tweets, reviews and web text, about 15% written by LLMs to fill gaps), labelled to the guide above by LLMs (plain fine-tuning, learning rate 4e-4). The source datasets are credited in NOTICE.
One size. Smaller is faster, larger is more accurate.
Run it on your own infrastructure. Open weights on Hugging Face.
Download the model, run it beside your own systems, and talk to us about tuning it to your data.