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-17M 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-17M 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-17M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("CobuildX-AI/cbx-indic-profanity-detector-17M") model = AutoModel.from_pretrained("CobuildX-AI/cbx-indic-profanity-detector-17M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,149 Bytes
aee0ee6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # 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}")
|