Exploring Data Augmentation Strategies for Hate Speech Detection in Roman Urdu

Ubaid Azam, Hammad Rizwan, Asim KarimLREC 2022

Abstract

In an era where social media platform users are growing rapidly, there has been a marked increase in hateful content being generated; to combat this, automatic hate speech detection systems are a necessity. For this purpose, researchers have recently focused their efforts on developing datasets, however, the vast majority of them have been generated for the English language, with only a few available for low-resource languages such as Roman Urdu. Furthermore, what few are available have small number of samples that pertain to hateful classes and these lack variations in topics and content. Thus, deep learning models trained on such datasets perform poorly when deployed in the real world. To improve performance the option of collecting and annotating more data can be very costly and time consuming. Thus, data augmentation techniques need to be explored to exploit already available datasets to improve model generalizability. In this paper, we explore different data augmentation techniques for the improvement of hate speech detection in Roman Urdu. We evaluate these augmentation techniques on two datasets. We are able to improve performance in the primary metric of comparison (F1 and Macro F1) as well as in recall, which is impertinent for human-in-the-loop AI systems.

Introduction

While AI models for hate speech detection have matured for English, "low-resource" languages like Roman Urdu (Urdu written in Latin script, common on social media) lag behind. Existing datasets for Roman Urdu are often small, imbalanced, and overfitted to specific timeframes. This creates a "catch-22": deep learning models require massive amounts of data to generalize well, but collecting and manually annotating new data is prohibitively expensive. To bridge this gap, this research investigates whether training data can be effectively "manufactured" through Data Augmentation (DA)—artificially expanding the dataset to teach models more variations of hateful and non-hateful speech.

Data Augmentation Strategies

The study evaluated several DA strategies, categorized into two main groups:

1. Easy Data Augmentation (EDA)

  • Synonym Replacement: Replacing random words with similar ones found via Word2Vec embeddings (since Roman Urdu lacks a formal WordNet).
  • Random Insertion: Inserting a synonym of a random word into a random position.
  • Random Swap: Randomly choosing two words in a sentence and swapping their positions.
  • Random Deletion: Randomly removing words. Crucially, a lexicon-based approach was used to ensure "hate words" weren't deleted, which would accidentally change a "toxic" label to "non-toxic."

2. Transformer-Based Augmentation

  • MT5 Text Generation: Using the Multilingual T5 model to generate new hateful samples by conditioning it on existing ones.
  • mBERT Masked Language Modeling (MLM): Randomly masking words in a sentence and asking a Multilingual BERT model to predict the missing word, creating a variation of the original text.
Examples of various data augmentation operations applied to a Roman Urdu sentence.

Experimental Setup

The study utilized two primary benchmarks for Roman Urdu:

  • RUSHOLD: A dataset of 10,012 tweets with five fine-grained labels (Abusive/Offensive, Sexism, Religious Hate, Profane, and Normal).
  • RUT (Roman Urdu Toxic): A much larger binary dataset (72,771 samples) categorized as either "toxic" or "non-toxic."

Both datasets are highly imbalanced; for instance, in RUT, only 18% of the samples are toxic, making it difficult for models to learn the characteristics of hate speech without augmentation.

Results and Discussion

Across almost all models (XLM-RoBERTa, mBERT, BiLSTM), at least one form of data augmentation improved the Macro F1-score compared to training on the raw, imbalanced data alone.

Performance comparison of transformer-based models across different augmentation strategies on the RUSHOLD dataset.

Key Insights

  • Recall Over Precision: In real-world moderation, it is often better to "over-flag" potential hate speech for a human to review (High Recall) than to let a hateful comment slip through (Low Recall). DA consistently improved Recall, making these models better suited for "human-in-the-loop" systems.
  • The Power of Simplicity: Surprisingly, "simple" techniques like Random Swap often performed as well as or better than complex transformer-based generation. This suggests that teaching a model to be invariant to word order is a powerful regularizer for Roman Urdu.
  • mBERT's Improvement: For the Multilingual BERT model on the RUSHOLD dataset, synonym replacement led to a 6-point jump in Macro F1-score (from 67.0 to 73.0), proving that even low-resource languages can benefit from cross-lingual embeddings.
  • Top Performance: On the RUSHOLD dataset, the BERT+CNN-gram model combined with MT5 Text Generation achieved the best results, reaching a Macro F1-score of 76.0 and a Recall of 75.0.

Conclusion and Future Work

While data augmentation shows significant promise, several hurdles remain. Because Roman Urdu has no standardized spelling or formal dictionaries, synonym replacement relies on noisy Word2Vec embeddings. Furthermore, while transformer-based models like MT5 can generate new text, the quality can be repetitive, and boosts in Recall sometimes come at the cost of Precision (more false positives).

Future research aims to develop more sophisticated generation techniques and expand these strategies to other regional languages facing similar resource constraints.

Summary updated

BibTeX
@inproceedings{azam2022exploring,
  author = {Ubaid Azam and Hammad Rizwan and Asim Karim},
  title = {{Exploring Data Augmentation Strategies for Hate Speech Detection in Roman Urdu}},
  booktitle = {LREC},
  year = {2022},
  url = {https://openreview.net/forum?id=tIOliNkPSW},
}
Figure