24 · Safety · Open weights

Offensive text flagged in 13 languages, with the reason.

cbx-indim-profanity-detector-32M

Flags offensive text in 12 Indian languages and English, native script, romanized or code-mixed, with the reason why.

Real inputs it was built for.

Not in the hosted Playground yet. Run it from the open weights on Hugging Face.

Romanized Hindi

Delivery bahut late aayi, customer care ne phone bhi nahi uthaya.

On Hugging Face

English

The product broke after a week. Very disappointed with the quality.

On Hugging Face

Benchmark

Measured against the alternative.

0.00

Offensive F1, gold test set (3,980 texts, two-LLM labels)

Full results ↗
  • cbx-indim-profanity-detector-32M0.88
  • mmBERT-base (307M)0.889
  • IndicBERT v2 (278M)0.888
  • mmBERT-small (140M)0.887

From the model card

Flags offensive text in 12 Indian languages and English (Hindi, Bengali, Marathi, Tamil, Telugu, Kannada, Malayalam, Gujarati, Punjabi, Odia, Assamese, Urdu, English), in native script, romanized or code-mixed, and says why: profanity, insult, hate and sexual, plus an overall offensive flag. It is InDIM-small (32M) fine-tuned for this task: about 6 ms for a short comment on a CPU (8 threads).

Model

32M

Licence

Apache 2.0

Fine-tuned from

CobuildX-AI/InDIM-small

Read the full model card ↗

Full results. Every number, from the card.

Gold test set: 3,980 texts never used in training: about 300 social-media comments per language (none for Gujarati, Punjabi, Odia and Assamese, which have no labelled comment data) and about 107 web passages per Indic language. Each text was labelled by two LLMs independently following a written guide, with a third deciding their disagreements. No person reviewed the gold labels, so they contain errors. Also Hindi HateCheck (Röttger et al. 2022; hateful and non-hateful test cases written by experts).

Every model was fine-tuned with the same data and recipe (plain fine-tuning, learning rate picked on validation, thresholds tuned on validation); mean of 3 training runs unless marked.

ModelParametersprofanityinsulthatesexualoffensiveMacro F1Clean texts flagged ↓HateCheck-hi hate F1 / PR-AUC
InDIM-small (this model's base)32M0.7090.6400.4360.8510.8800.7035.9%0.31 / 0.749
mmBERT-small140M0.7510.6760.4600.8510.8870.7255.3%0.36 / 0.742
mmBERT-base (1 run)307M0.7530.6910.5050.8730.8890.7423.9%0.53 / 0.759
IndicBERT v2278M0.6900.7190.4500.8630.8880.7224.7%0.41 / 0.744

"Clean texts flagged": share of the 1,693 gold texts with none of the four labels on which any label fires.

  • This repository holds the training run with the best validation score: gold macro F1 0.688 (per label in the Labels table), clean texts flagged 7.7%, HateCheck-hi hate recall 0.26.
  • On this task InDIM-small is about 2 points of macro F1 below the larger models, mostly on insult and profanity; it ranks HateCheck cases about as well as mmBERT-base (PR-AUC) but flags fewer of them at its threshold. Choose it when speed or CPU cost matters more than the last points of recall.

CPU latency (Intel i7-10700, 8 threads, one text at a time, PyTorch fp32): 6.2 ms for a 28-token comment, 24 ms for a full 256-token chunk. fp16 is exact; ONNX int8 changed 7% of decisions in our test, so only the fp32 ONNX file is provided.

Know its limits. Before you ship it.

Limitations

  • hate is weak. On the gold set most hate flags are wrong (often strong personal abuse with no identity target) and it finds less than half of hateful texts; on Hindi HateCheck it finds about a quarter. Do not rely on it to find hate speech, and check every hate flag.
  • Mild insults are often missed (insult recall 0.46): rude but not vulgar words such as "idiot" or "bewakoof" often score below the threshold.
  • Gujarati, Punjabi, Odia, Assamese and native-script Urdu have little or no labelled comment data; expect more errors on comments in these languages.
  • Bias. Dialect words, caste and community terms, reclaimed words and counter-speech that quotes abuse can be flagged wrongly; mild words can be missed. Errors are not spread evenly across languages, scripts or communities.
  • Labels are from LLMs, not people, both for training and for the gold set. The guide's choices (for example, that criticism of a political party is not hate) are one reasonable reading, not the only one.
  • Context. The model sees one text. Sarcasm, quotes, in-group banter and comments about images or videos are often misread.

Training data

What it learned from.

InDIM-small (32M) fine-tuned on social-media comments from public datasets and web text in the 13 languages, labelled to the written guide by LLMs (plain fine-tuning, five sigmoid heads, learning rate 4e-4, thresholds per label picked on validation). 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.