[Paper Review] Leveraging Transformers for Hate Speech Detection in Conversational Code-Mixed Tweets
This paper proposes a transformer-based ensemble system for hate speech detection in Hindi-English code-mixed Twitter conversations, leveraging Indic-BERT, XLM-RoBERTa, and Multilingual BERT with hard voting. The best-performing model achieved a macro F1 score of 0.7253, securing 1st place in the HASOC 2021 Subtask 2 leaderboard by effectively capturing contextual nuances in low-resource, code-switched social media text.
In the current era of the internet, where social media platforms are easily accessible for everyone, people often have to deal with threats, identity attacks, hate, and bullying due to their association with a cast, creed, gender, religion, or even acceptance or rejection of a notion. Existing works in hate speech detection primarily focus on individual comment classification as a sequence labeling task and often fail to consider the context of the conversation. The context of a conversation often plays a substantial role when determining the author's intent and sentiment behind the tweet. This paper describes the system proposed by team MIDAS-IIITD for HASOC 2021 subtask 2, one of the first shared tasks focusing on detecting hate speech from Hindi-English code-mixed conversations on Twitter. We approach this problem using neural networks, leveraging the transformer's cross-lingual embeddings and further finetuning them for low-resource hate-speech classification in transliterated Hindi text. Our best performing system, a hard voting ensemble of Indic-BERT, XLM-RoBERTa, and Multilingual BERT, achieved a macro F1 score of 0.7253, placing us first on the overall leaderboard standings.
Motivation & Objective
- To address the challenge of detecting hate speech in conversational, code-mixed Hindi-English Twitter content where toxicity may be implicit and context-dependent.
- To improve low-resource hate speech classification in transliterated Hindi text using cross-lingual transformer embeddings.
- To evaluate the effectiveness of ensemble learning in mitigating class-specific misclassification bias in hate speech detection.
- To develop a system capable of identifying implicit hate in replies and comments that are not overtly offensive but contribute to a toxic conversation chain.
Proposed method
- Fine-tuned pre-trained multilingual transformers—Indic-BERT, XLM-RoBERTa, and Multilingual BERT—on a code-mixed hate speech dataset for Hindi-English tweets.
- Constructed a hard voting ensemble model by aggregating predictions from all three transformer models to improve robustness and generalization.
- Utilized the full conversation context (parent tweet, replies, and comments) as input to capture implicit hate and intent.
- Applied soft and hard voting strategies to combine model outputs, with hard voting yielding superior performance.
- Performed extensive hyperparameter tuning and validation on the HASOC 2021 dataset to optimize model generalization.
- Conducted error analysis using confusion matrices and misclassification rates to identify class-specific weaknesses and model behavior.
Experimental results
Research questions
- RQ1Can pre-trained multilingual transformers effectively detect hate speech in low-resource, code-switched Hindi-English Twitter conversations?
- RQ2How does ensemble learning improve hate speech detection performance compared to individual transformer models in this low-resource setting?
- RQ3To what extent does incorporating conversation context enhance the detection of implicit hate not present in individual comments?
- RQ4Why do certain models exhibit higher misclassification rates for the 'NOT' (non-offensive) class, and can ensembling mitigate this bias?
Key findings
- The hard voting ensemble of Indic-BERT, XLM-RoBERTa, and Multilingual BERT achieved the highest macro F1 score of 0.7253, securing 1st place in the HASOC 2021 Subtask 2 leaderboard.
- The ensemble models reduced misclassification rates for both HOF (hateful/offensive) and NOT (non-offensive) classes compared to individual models, with the HOF class misclassification rate dropping to 23.74%.
- Indic-BERT showed a significantly higher misclassification rate for the NOT class (40.27%) compared to HOF (23.30%), indicating a class imbalance in its predictions.
- Multilingual BERT and XLM-RoBERTa exhibited balanced misclassification rates (~29-31%) across both classes, suggesting more consistent performance.
- The hard voting ensemble outperformed the soft voting ensemble (macro F1 0.7223), indicating that hard voting better resolved prediction conflicts in this context.
- Despite improvements, the ensemble still misclassified 7-8% more samples in the NOT class than in the HOF class, highlighting ongoing challenges in detecting non-toxic content accurately.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.