Text Classification
Transformers
Safetensors
modernbert
feature-extraction
profanity
offensive-language
hate-speech
content-moderation
indic
multilingual
code-mixed
multi-label
text-embeddings-inference
Instructions to use CobuildX-AI/cbx-indic-profanity-detector-36M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CobuildX-AI/cbx-indic-profanity-detector-36M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="CobuildX-AI/cbx-indic-profanity-detector-36M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("CobuildX-AI/cbx-indic-profanity-detector-36M") model = AutoModel.from_pretrained("CobuildX-AI/cbx-indic-profanity-detector-36M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download example.py from CobuildX-AI/cbx-indic-profanity-detector-36M: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/CobuildX-AI/cbx-indic-profanity-detector-36M/resolve/main/example.py
- Command line
-
hf download hf://CobuildX-AI/cbx-indic-profanity-detector-36M/example.py
-
curl -L -o example.py https://huggingface.co/CobuildX-AI/cbx-indic-profanity-detector-36M/resolve/main/example.py
1.15 kB
| # Copyright 2026 Cobuild Tech Private Limited | |
| # SPDX-License-Identifier: Apache-2.0 | |
| """Run from the model folder: python example.py (every text below is invented for this example)""" | |
| from cbx_profanity import ProfanityClassifier | |
| clf = ProfanityClassifier(".") | |
| texts = [ | |
| "Thanks for sharing the recipe, my mother makes it the same way every Diwali.", | |
| "शाम को बारिश हो सकती है, छाता साथ रखना।", # Hindi: it may rain in the evening, take an umbrella | |
| "நாளைக்கு கூட்டம் பத்து மணிக்கு தொடங்கும்.", # Tamil: tomorrow's meeting starts at ten | |
| "bc aaj traffic bahut kharab hai, ek ghanta phas gaya", # romanized Hindi: swearing, not aimed at anyone | |
| "saala harami, teri aukaat kya hai", # romanized Hindi: abuse aimed at the reader | |
| "What a stupid useless idiot, nobody asked for your opinion.", | |
| ] | |
| for text, r in zip(texts, clf.classify(texts)): | |
| print(f"{'OFFENSIVE' if r['offensive'] else 'clean '} {','.join(r['labels']) or '-':<24} {text}") | |