Deep Context-Aware Embedding for Abusive and Hate Speech detection on Twitter

Usman Naseem, Imran Razzak, Ibrahim A. HameedAust. J. Intell. Inf. Process. Syst 2019

Introduction

The proliferation of abusive language and hate speech on social media platforms like Twitter presents a significant challenge for automated moderation systems. Unlike formal text, tweets are characterized by linguistic "noise," including polysemy (words with context-dependent meanings), out-of-vocabulary (OOV) terms such as slang and intentional misspellings, and informal grammatical structures. Traditional natural language processing (NLP) models, which often rely on static word embeddings or simple keyword matching, frequently fail to capture the nuanced intent behind such content. This paper presents a deep context-aware approach designed to navigate these complexities by integrating multi-level linguistic representations.

Proposed Methodology

The core of the proposed system is the Deep Hybrid Contextual Word Representation. This architecture fuses three distinct layers of information to create a robust embedding for each token:

  1. Word-Char Level Representation: This layer combines standard Word2Vec embeddings with a character-level Bidirectional Long Short-Term Memory (BiLSTM) network. This dual approach allows the model to infer the meaning of OOV words and slang by analyzing sub-word patterns.
  2. Context-Level Representation (ELMo): By utilizing Embeddings from Language Models (ELMo), the system generates dynamic vectors that change based on the surrounding words. This effectively addresses the problem of polysemy, where the same word may be benign or abusive depending on its context.
  3. Lexicon-Level Representation: The model incorporates sentiment-specific data from SenticNet 5.0. By extracting negative sentiment scores, the model gains an emotional "prior" that helps identify words carrying heavy aggressive or hateful baggage.

These representations are concatenated and processed through a BiLSTM network equipped with an Attention mechanism. The attention layer enables the model to selectively focus on the most salient words in a tweet—such as specific slurs or hostile verbs—while down-weighting neutral connectors.

Architecture of the proposed Deep Hybrid Contextual Word Representation model.

Experimental Setup

The model's performance was evaluated using three benchmark datasets to ensure robustness across different types of abusive language:

  • Dataset 1 (Waseem et al.): Approximately 15,844 tweets labeled as Racism, Sexism, or None.
  • Dataset 2 (Davidson et al.): Approximately 25,112 tweets categorized as Hateful, Offensive, or Neither.
  • Dataset 3 (Golbeck et al.): Approximately 20,362 tweets focused specifically on online harassment.

Results and Analysis

The proposed model consistently demonstrated superior or competitive performance compared to established baselines, including various combinations of CNNs, LSTMs, and Gradient Boosted Decision Trees (GBDT).

Performance comparison (F1-score) of the proposed model against various baselines across three datasets.

Key performance metrics include:

  • Dataset 1: The model achieved an F1-score of 85.5%. Notably, the researchers observed that a previously reported 93% F1-score for an LSTM+GBDT baseline was not reproducible in their controlled environment, making the proposed model the new state-of-the-art for this benchmark.
  • Dataset 2: The model reached a high F1-score of 92.3%, proving effective at distinguishing between "hateful" content and general "offensive" language.
  • Dataset 3: The model achieved 73.6%, a significant improvement over the 65.7% baseline, highlighting its strength in detecting targeted harassment.

Conclusion

By integrating character-level analysis, context-sensitive embeddings, and sentiment lexicons, the proposed model offers a more "human-like" understanding of social media discourse. While the system marks a significant advancement, challenges remain in detecting sarcasm and adapting to multilingual environments. Future work will focus on incorporating cross-lingual embeddings and refining the model's ability to interpret complex social cues.

Summary updated

BibTeX
@article{naseem2019deep,
  author = {Usman Naseem and Imran Razzak and Ibrahim A. Hameed},
  title = {{Deep Context-Aware Embedding for Abusive and Hate Speech detection on Twitter}},
  journal = {Aust. J. Intell. Inf. Process. Syst.},
  year = {2019},
  url = {https://openreview.net/forum?id=RTt3dFTYSL},
}
Figure