TL;DR
Researchers from IIT Kharagpur utilized Transformer-based models like XLM-RoBERTa and mBERT to detect hate speech across English, Hindi, Marathi, and Code-Mixed (Hinglish) social media posts. Their approach, which emphasized handling class imbalance and leveraging multilingual pre-training, secured top-tier rankings in the HASOC 2021 competition, demonstrating that large-scale multilingual models are increasingly robust for low-resource language moderation.
What Problem Does This Paper Address?
Online platforms face an overwhelming volume of content, making manual moderation of hate speech and offensive language impossible. While automated detection systems exist, they are heavily biased toward high-resource languages like English.
This paper addresses the critical gap in moderation tools for Indo-Aryan languages (Hindi and Marathi) and "Code-Mixed" content—where users blend multiple languages (e.g., Hindi written in Roman script mixed with English) in a single post. These languages are often considered "low-resource" in the context of Natural Language Processing (NLP) because they lack the massive, high-quality labeled datasets available for English. Furthermore, the authors tackle the nuance of "conversational hate speech," where a comment might only appear hateful when viewed in the context of the post it is replying to.
Methods
The authors experimented with several state-of-the-art Transformer architectures under the team name "Super Mario." Their pipeline involved:
- Model Selection: They compared mBERT (multilingual BERT), XLM-RoBERTa (base and large), Indic-BERT (specifically pre-trained on Indian languages), and dehate-BERT (a model already fine-tuned for hate speech).
- Preprocessing: To clean noisy Twitter data, they replaced usernames with generic tags, removed URLs and emojis, but crucially retained hashtags, as these often contain vital contextual information for identifying hate speech.
- Weighted Loss Functions: Real-world hate speech datasets are often imbalanced (e.g., much more "Non-Hate" than "Hate"). The authors implemented a Weighted Cross-Entropy loss, assigning higher importance to the minority classes during training to prevent the model from simply ignoring them.
- Fine-tuning: Models were fine-tuned for 20 epochs using the Adam optimizer, focusing on both binary classification (Hate vs. Not Hate) and fine-grained classification (Hate, Offensive, Profane, or None).
Datasets
The study utilized datasets provided by the HASOC 2021 (Hate Speech and Offensive Content Identification) track at the FIRE conference:
- Subtask 1A: Binary classification for English, Hindi, and Marathi.
- Subtask 1B: Fine-grained four-class classification for English and Hindi.
- Subtask 2: Identification of conversational hate speech in Code-Mixed Hindi/English threads.
Key Insights and Ideas
- The Stability of XLM-RoBERTa: One of the most significant findings was the robustness of XLM-RoBERTa-large. While mBERT's performance fluctuated by as much as 6-7% depending on the random seed used during training, XLM-RoBERTa remained stable within a 1-2% margin. This suggests XLMR is a more reliable choice for production-level moderation systems.
- Context is King: The authors highlight that conversational threads change the meaning of words. A neutral word like "Amine" (meaning "truthfully" or "so be it") can become a marker of hate speech if it is used to support a hateful parent tweet.
- Multilingual vs. Specialized Models: Interestingly, general multilingual models like XLMR and mBERT often outperformed specialized models like Indic-BERT. This suggests that the massive scale of pre-training in models like XLMR provides a "transfer learning" advantage that outweighs the benefits of language-specific pre-training on smaller corpora.
Key Results
The "Super Mario" team achieved highly competitive results across the board:
- Code-Mixed Data: 2nd position (Macro F1: 0.7107) using a custom XLM-RoBERTa-large.
- Hindi Binary Classification: 2nd position (Macro F1: 0.7797) using mBERT.
- English Binary Classification: 0.8006 Macro F1 (Ranked 4th).
- English Four-Class Classification: 0.6447 Macro F1 (Ranked 12th).
- Marathi: Post-competition implementation reached a Macro F1 of 0.8756, which would have placed them 3rd in the original standings.
Limitations and Future Work
The authors noted two primary areas for improvement:
- Underperformance of Specialized Models: They plan to investigate why Indic-BERT and dehate-BERT did not provide the expected performance boost, despite being tailored for the specific languages or tasks at hand.
- Seed Sensitivity: The high variance in mBERT performance remains a concern. Future work will look into the underlying reasons why certain Transformer architectures are more sensitive to initial conditions than others.
- Deeper Contextual Analysis: While they touched on conversational threads, the authors suggest that more sophisticated "tree-structured" data processing is needed to fully capture the dynamics of multi-turn hateful exchanges.
Summary updated