Tutorial: Fine-Tuning mBERT to Detect Toxicity in Hinglish Social Media Text
A new technical guide published on DEV Community explains how to fine-tune Google's multilingual BERT model (mBERT) to classify toxic content in Hinglish, the code-mixed Hindi-English language common on Indian social media. Standard English toxicity classifiers fail on Hinglish because they were never trained on mixed-script, code-switched text that blends Devanagari and Latin characters. The tutorial covers the full pipeline — data loading, tokenization, model building, training, and evaluation — using a balanced 500-row labeled dataset of toxic and non-toxic Hinglish posts. mBERT is chosen as the base model because its tokenizer was pre-trained across 104 languages, giving it subword coverage for both Hindi and English scripts. The guide notes that the entire process can run on a standard CPU in roughly 15 to 20 minutes, making it accessible without specialist hardware.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in