Comparative Studies of Detecting Abusive Language on Twitter

Younghun Lee, Seunghyun Yoon, Kyomin Jung

Abstract

The context-dependent nature of online aggression makes annotating large collections of data extremely difficult. Previously studied datasets in abusive language detection have been insufficient in size to efficiently train deep learning models. Recently, Hate and Abusive Speech on Twitter, a dataset much greater in size and reliability, has been released. However, this dataset has not been comprehensively studied to its potential. In this paper, we conduct the first comparative study of various learning models on Hate and Abusive Speech on Twitter, and discuss the possibility of using additional features and context data for improvements. Experimental results show that bidirectional GRU networks trained on word-level features, with Latent Topic Clustering modules, is the most accurate model scoring 0.805 F1.

Introduction

Detecting abusive language online is notoriously difficult because toxicity is highly subjective and context-dependent. A harmless-looking tweet might actually be a vicious attack when viewed as a reply to a specific thread. Historically, datasets for this task have been too small (10K–35K examples) to effectively train data-hungry deep learning models, forcing researchers to rely on traditional machine learning.

This study addresses this gap by providing the first comprehensive baseline for the Hate and Abusive Speech on Twitter dataset, which contains approximately 100K tweets. We benchmark a wide array of traditional and neural models while exploring how contextual conversational data impacts classification accuracy.

Dataset and Methodology

We utilized the dataset introduced by Founta et al. (2018). Due to the transient nature of Twitter data (deleted tweets and suspended accounts), we were able to retrieve 70,904 tweets from the original IDs. As shown in Figure 1, the dataset is heavily imbalanced, with "Hateful" content making up only 4.4% of the total samples.

Distribution of labels in the Hate and Abusive Speech on Twitter dataset showing significant class imbalance.

Experimental Setup

We evaluated two main categories of models:

  • Traditional ML: Naive Bayes, Logistic Regression, SVM, Random Forests, and Gradient Boosted Trees, trained using TF-IDF on word-level and character-level features.
  • Neural Networks: Word-level, character-level, and hybrid Convolutional Neural Networks (CNNs), and Bidirectional Recurrent Neural Networks (RNNs using GRUs).
  • Advanced Variants: We augmented RNNs with self-matching attention mechanisms and Latent Topic Clustering (LTC) to better capture semantic meaning.
  • Contextual Extension: To address context-dependency, we introduced "context tweets" (the tweet being replied to). We concatenated the vector representations of the context tweet with the target tweet to provide the model with conversational premise.

Results and Discussion

The comparative performance of these models is detailed in Figure 2.

Performance comparison across traditional and deep learning models, highlighting the superiority of RNN-LTC and the impact of context.

Key Findings

  • Model Performance: The RNN with Latent Topic Clustering (RNN-LTC) using word-level features achieved the highest overall performance with an F1 score of 0.805. Among traditional models, word-level Logistic Regression performed remarkably well, matching the baseline CNN with an F1 of 0.780.
  • The Character-Level Paradox: While character-level features helped traditional ML models handle obfuscated language, they surprisingly decreased neural network accuracy. This suggests the dataset, while larger than predecessors, may still be too small for neural networks to learn effective character representations from scratch.
  • The Power of Context: Incorporating "context tweets" proved vital for minority classes. Adding context to the CNN model yielded the highest F1 score for the rare "hateful" label (0.309). Similarly, context-aware RNNs achieved the highest recall for the "abusive" label (0.937).

Conclusion

While deep learning models generally outperform traditional methods on this larger dataset, class imbalance remains a significant challenge. Our results demonstrate that context is king for identifying edge cases like hate speech. Future work will focus on building ensemble models that combine the strengths of different architectures—such as the high recall of context-aware RNNs and the precision of LTC modules—to achieve robust performance across all categories.

Summary updated

Abstract

The context-dependent nature of online aggression makes annotating large collections of data extremely difficult. Previously studied datasets in abusive language detection have been insufficient in size to efficiently train deep learning models. Recently, Hate and Abusive Speech on Twitter, a dataset much greater in size and reliability, has been released. However, this dataset has not been comprehensively studied to its potential. In this paper, we conduct the first comparative study of various learning models on Hate and Abusive Speech on Twitter, and discuss the possibility of using additional features and context data for improvements. Experimental results show that bidirectional GRU networks trained on word-level features, with Latent Topic Clustering modules, is the most accurate model scoring 0.805 F1.
BibTeX
@inproceedings{lee2018comparative,
  author = {Younghun Lee and Seunghyun Yoon and Kyomin Jung},
  title = {{Comparative Studies of Detecting Abusive Language on Twitter}},
  booktitle = {ALW},
  year = {2018},
  doi = {10.18653/v1/w18-5113},
}
Figure