Downloads · 30 days
40
45% of all-time downloads
darelphilip/hinglisToxicity_darel_mmberta
hinglisToxicity_darel_mmberta is a text classification model from darelphilip. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
A fine-tuned sequence classification model designed for precise multi-label toxicity detection in Hinglish (Hindi-English code-switched) text. It classifies text across 7 distinct toxicity and identity-based discrimin…
Downloads · 30 days
40
45% of all-time downloads
All-time downloads
89
Public
Parameters
308M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 97%
From the Hugging Face model README
darelphilip/hinglisToxicity_darel_mmberta)A fine-tuned sequence classification model designed for precise multi-label toxicity detection in Hinglish (Hindi-English code-switched) text. It classifies text across 7 distinct toxicity and identity-based discrimination vectors common to South Asian digital spaces.
🚀 Live Interactive Demo: Test this model's batch-processing capabilities in real-time on Hugging Face Spaces.
This model leverages the jhu-clsp/mmBERT-base foundation (ModernBERT architecture) utilizing native Scaled Dot-Product Attention (SDPA) and Gemma 2 tokenization. It was fine-tuned on over 245,000 code-switched online comments to identify specific vectors of abuse, profanity, and harassment. The training process utilized a weighted Binary Cross-Entropy loss function (pos_weight) to penalize false negatives on severe but underrepresented hate speech categories.
darelphilip)hi-en), Hindi (hi), English (en)jhu-clsp/mmBERT-baseThe model outputs independent probabilities for 7 classes:
profanity_vulgaritytargeted_abuse_harassmentdiscriminatory_hate_speechcastecommunal_religiousregional_xenophobicmisogyny_genderprofanity_vulgarity category.Use the code below for multi-label inference:
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
MODEL_ID = "darelphilip/hinglisToxicity_darel_mmberta"
LABEL_COLS = [
'profanity_vulgarity', 'targeted_abuse_harassment', 'discriminatory_hate_speech',
'caste', 'communal_religious', 'regional_xenophobic', 'misogyny_gender'
]
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID)
text = "kya bakwaas chal raha hai yahan"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=160)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.sigmoid(logits).squeeze().tolist()
scores = dict(zip(LABEL_COLS, [round(p, 4) for p in probs]))
print(f"Comment: {text}")
for label, score in scores.items():
print(f" {label:<30}: {score:.4f} {'🚨' if score > 0.5 else ''}")