Skip to main content
QUICK REVIEW

[Paper Review] Enhanced Offensive Language Detection Through Data Augmentation

Ruibo Liu, Guangxuan Xu|arXiv (Cornell University)|Dec 5, 2020
Hate Speech and Cyberbullying DetectionComputer Science9 references5 citations
TL;DR

This paper proposes Dager, a GPT-2-based data augmentation method that generates synthetic offensive language tweets by leveraging class-specific lexical features to improve classification on imbalanced datasets. It boosts F1 scores by 11% when training on just 1% of the ICWSM-2020 dataset, with consistent improvements across multiple classifiers and strong label preservation in generated data.

ABSTRACT

Detecting offensive language on social media is an important task. The ICWSM-2020 Data Challenge Task 2 is aimed at identifying offensive content using a crowd-sourced dataset containing 100k labelled tweets. The dataset, however, suffers from class imbalance, where certain labels are extremely rare compared with other classes (e.g, the hateful class is only 5% of the data). In this work, we present Dager (Data Augmenter), a generation-based data augmentation method, that improves the performance of classification on imbalanced and low-resource data such as the offensive language dataset. Dager extracts the lexical features of a given class, and uses these features to guide the generation of a conditional generator built on GPT-2. The generated text can then be added to the training set as augmentation data. We show that applying Dager can increase the F1 score of the data challenge by 11% when we use 1% of the whole dataset for training (using BERT for classification); moreover, the generated data also preserves the original labels very well. We test Dager on four different classifiers (BERT, CNN, Bi-LSTM with attention, and Transformer), observing universal improvement on the detection, indicating our method is effective and classifier-agnostic.

Motivation & Objective

  • To address class imbalance in offensive language detection, particularly for rare labels like 'hateful' speech.
  • To improve low-resource and imbalanced text classification without requiring external datasets or auxiliary training.
  • To develop a classifier-agnostic data augmentation method that enhances model generalization on minority classes.
  • To evaluate whether large language models can effectively generate high-quality, label-preserving synthetic data for downstream NLP tasks.

Proposed method

  • Dager uses a conditional generator based on GPT-2, fine-tuned to generate text conditioned on specific offensive language labels.
  • It extracts lexical features from each target class (e.g., hateful) to guide the generation process.
  • Conditional generation is implemented via Bayesian inference: P(xₜ|c) ∝ P(xₜ)P(c|xₜ), where c is the class label and xₜ is the token at step t.
  • The method injects class-conditioning signals during decoding to steer the autoregressive generation toward desired labels.
  • Generated samples are added to the training set to balance class distributions and improve model generalization.
  • The approach is applied to four classifiers (BERT, CNN, Bi-LSTM with attention, Transformer), demonstrating broad applicability.

Experimental results

Research questions

  • RQ1Can GPT-2-based data augmentation significantly improve offensive language detection performance on low-resource, imbalanced datasets?
  • RQ2Does the generated synthetic data preserve the original class labels with high fidelity?
  • RQ3Is the data augmentation method effective and robust across diverse neural network architectures?
  • RQ4How does performance scale with varying amounts of original training data when augmented with synthetic samples?

Key findings

  • Dager improves the F1 score by 11 percentage points when training on only 1% of the ICWSM-2020 dataset, compared to the baseline.
  • Even with 70% of the training data being synthetic, the F1 score decreases by only 12.5%, indicating strong label preservation.
  • The method improves performance across all four tested classifiers (BERT, CNN, Bi-LSTM with attention, Transformer), confirming its classifier-agnostic nature.
  • The highest relative gains are observed in low-data regimes (e.g., 20% of training data), where Dager boosts performance by up to 7% absolute F1 improvement.
  • The method maintains high-quality semantic and syntactic diversity in generated text, outperforming simple word-replacement augmentation techniques.
  • When the training set is augmented to 80% of the full dataset size using Dager, the F1 score reaches 0.8157, nearly matching the 0.8139 of the full original set.

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.