Skip to main content
QUICK REVIEW

[Paper Review] Exploring Transformer Based Models to Identify Hate Speech and Offensive Content in English and Indo-Aryan Languages

Somnath Banerjee, Maulindu Sarkar|arXiv (Cornell University)|Nov 27, 2021
Hate Speech and Cyberbullying DetectionComputer Science16 citations
TL;DR

This paper evaluates Transformer-based models—particularly XLM-RoBERTa-large—for hate speech and offensive content detection in English and Indo-Aryan languages (Hindi, Marathi, code-mixed). Using class weighting and fine-tuning on FIRE 2021 shared task data, XLM-RoBERTa-large achieved second place in code-mixed (Macro F1: 0.7107) and Hindi two-class (0.7797), and third in Marathi (0.8756), outperforming mBERT and specialized models like IndicBERT.

ABSTRACT

Hate speech is considered to be one of the major issues currently plaguing online social media. Repeated and repetitive exposure to hate speech has been shown to create physiological effects on the target users. Thus, hate speech, in all its forms, should be addressed on these platforms in order to maintain good health. In this paper, we explored several Transformer based machine learning models for the detection of hate speech and offensive content in English and Indo-Aryan languages at FIRE 2021. We explore several models such as mBERT, XLMR-large, XLMR-base by team name "Super Mario". Our models came 2nd position in Code-Mixed Data set (Macro F1: 0.7107), 2nd position in Hindi two-class classification(Macro F1: 0.7797), 4th in English four-class category (Macro F1: 0.8006) and 12th in English two-class category (Macro F1: 0.6447).

Motivation & Objective

  • To address the challenge of detecting hate and offensive speech in low-resource Indo-Aryan languages, including Hindi, Marathi, and code-mixed English-Hindi text.
  • To evaluate the effectiveness of multilingual and multilingual-specific Transformer models in low-resource settings for hate speech detection.
  • To investigate the impact of class imbalance and data balancing techniques on model performance in low-resource language classification.
  • To compare state-of-the-art models like mBERT, XLM-RoBERTa, IndicBERT, and dehateBERT in multilingual and low-resource contexts.
  • To analyze model robustness across different random seeds, especially in low-resource language scenarios.

Proposed method

  • Fine-tuned multilingual Transformer models—including XLM-RoBERTa-base, XLM-RoBERTa-large, mBERT-base, IndicBERT, and dehateBERT—on the FIRE 2021 shared task datasets.
  • Applied class weighting to mitigate data imbalance in both two-class (HOF vs. NOT) and four-class (HATE, OFFN, PRFN, NONE) classification tasks.
  • Used Hugging Face and PyTorch for model training with Adam optimizer and cross-entropy loss, with 20 epochs of fine-tuning on target datasets.
  • Employed a custom fine-tuned XLM-RoBERTa-large for code-mixed data, improving performance over standard variants.
  • Evaluated models using Macro F1 score across multiple language and task configurations, including English, Hindi, Marathi, and code-mixed data.
  • Conducted experiments with multiple random seeds to assess model stability and variance in performance across runs.

Experimental results

Research questions

  • RQ1How do multilingual Transformer models perform in detecting hate and offensive content in low-resource Indo-Aryan languages such as Hindi and Marathi?
  • RQ2What is the comparative effectiveness of XLM-RoBERTa-large, mBERT, and specialized models like IndicBERT and dehateBERT in low-resource hate speech detection?
  • RQ3To what extent does class weighting improve model performance on imbalanced datasets in multilingual hate speech classification?
  • RQ4How stable are the performance results across different random seeds, particularly for XLM-RoBERTa versus mBERT?
  • RQ5Why do specialized models like IndicBERT and dehateBERT underperform compared to general multilingual models in this low-resource setting?

Key findings

  • XLM-RoBERTa-large achieved the highest Macro F1 score of 0.8006 in the English four-class classification task, securing 2nd place in the competition.
  • In the Hindi two-class classification, mBERT achieved the best performance with a Macro F1 of 0.7797, ranking 2nd overall.
  • For code-mixed data, the custom fine-tuned XLM-RoBERTa-large model achieved a Macro F1 of 0.7107, placing 2nd in the shared task.
  • In post-competition evaluation, XLM-RoBERTa-large achieved a Macro F1 of 0.8756 on the Marathi dataset, matching the 3rd-place team.
  • XLM-RoBERTa models showed significantly lower variance in performance across random seeds (max 1-2% variation) compared to mBERT (6-7% variation).
  • IndicBERT and dehateBERT underperformed compared to XLM-RoBERTa and mBERT, despite being specifically designed for Indian languages or hate speech detection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.