Arabic Offensive Language on Twitter: Analysis and Experiments

Hamdy Mubarak, Ammar Rashed, Kareem Darwish, Younes Samih, Ahmed Abdelali

TL;DR

This paper tackles the challenge of detecting offensive language in Arabic on Twitter by introducing the largest publicly available dataset for this task. They developed a novel, bias-free methodology for dataset creation and conducted a thorough analysis of Arabic offensive language, followed by experiments with state-of-the-art models that achieved impressive F1 scores.

What Problem Does This Paper Address?

Online platforms like Twitter are rife with offensive language, which can manifest as cyberbullying, hate speech, and propaganda, impacting social discourse and potentially inciting real-world harm. While research on offensive language detection has grown, particularly for English, the Arabic language has been comparatively underserved. Existing Arabic datasets are often small, biased by topic or dialect, or lack fine-grained labels for different types of offensive content. This paper aims to bridge this gap by creating a comprehensive, unbiased Arabic offensive language dataset and developing robust detection models.

Methods

The authors introduce a novel methodology for building their Arabic offensive tweet dataset. Instead of relying on seed lists of offensive words (which can introduce bias), they leverage the vocative particle "يا" (ya), often used in Arabic to address someone directly. They observed that tweets containing this particle, especially multiple instances, are more likely to be offensive. By collecting tweets with this pattern, they created a larger, more diverse sample.

For analysis, they manually annotated tweets for offensiveness, vulgarity, and hate speech, developing detailed guidelines compatible with existing standards like OffensEval2019. They also analyzed topics, dialects, and user demographics associated with offensive language.

For classification, they experimented with various approaches:

  • Lexical Features: Using a polarity lexicon (NileULex) to count positive and negative terms.
  • Static Embeddings: Employing pre-trained embeddings like fastText, AraVec, and Mazajak, as well as training embeddings directly on their dataset.
  • Deep Contextualized Embeddings: Fine-tuning pre-trained models like BERTbase-multilingual and their specifically trained AraBERT model.

They compared these representations with several classification models, including SVM, AdaBoost, and Logistic Regression, and fine-tuned Transformer models.

Datasets

The primary dataset introduced in this paper is a collection of 10,000 Arabic tweets, specifically curated for offensive language detection. This dataset is notable for:

  • Being the largest publicly available Arabic offensive tweet dataset to date.
  • Being bias-free regarding topic, dialect, or target, achieved through their novel collection methodology.
  • Including special tags for vulgarity and hate speech, in addition to general offensiveness.
  • Being annotated with detailed guidelines compatible with OffensEval2019.

The authors plan to make this dataset publicly available.

Key Insights and Ideas

  • The "Ya" Particle as a Signal: The observation that the vocative particle "يا" (ya) is a strong indicator of potential offensiveness, especially when used multiple times, is a clever and effective heuristic for data collection. This approach avoids the inherent biases of keyword-based filtering.
  • Arabic Offensive Language is Diverse: The analysis reveals that offensive language in Arabic spans various topics, with sports and politics being dominant. It also highlights the prevalence of specific dialects (Egyptian and Gulf) and a strong male authorship for offensive tweets.
  • Context is Crucial for Arabic: The paper emphasizes that simple string matching can fail due to the nuances of Arabic, including idioms, sarcasm, and implicit offensiveness, underscoring the need for sophisticated NLP models.
  • AraBERT's Strong Performance: The fine-tuned AraBERT model achieved state-of-the-art results, even though it wasn't specifically trained on social media data. This suggests the power of pre-trained Transformer models for understanding Arabic nuances, and hints that further improvements could be made by training on social media text.

Key Results

  • The authors successfully built and annotated a 10,000-tweet Arabic dataset, with approximately 19% of tweets labeled as offensive.
  • The dataset includes 225 vulgar tweets and 506 hate speech tweets.
  • Inter-Annotator Agreement (IIA) was very high, with Fleiss's Kappa coefficients of 0.92 and 0.97, indicating high-quality annotations.
  • The best performing model, fine-tuned AraBERT, achieved an F1 score of 83.2.
  • Mazajak embeddings combined with an SVM classifier also performed strongly, achieving an F1 score of 79.7.
  • Analysis showed sports and politics as the most dominant topics for offensive language.
  • Egyptian (EGY) and Gulf (GLF) dialects were most prevalent in offensive tweets.
  • The vast majority of offensive tweets were authored by males.

Limitations and Future Work

  • Limitations:
    • While the "ya" particle method is innovative, it might not capture all offensive language, potentially missing some stylistic variations.
  • The authors acknowledge that even with their methodology, offensive tweets still constitute a small percentage of the overall data, making annotation inherently challenging.
  • Future Work:
    • Target-Specific Offensive Language: Exploring how offensive language is tailored to specific targets or groups, where expressions might be offensive only in a particular context.
  • Cross-Dialectal and Cross-Lingual Learning: Investigating the effectiveness of learning offensive language patterns across different Arabic dialects and even across languages.
  • Pre-training on Social Media: The success of AraBERT suggests that further improvements could be achieved by pre-training Transformer models specifically on Arabic social media text.

Summary updated

BibTeX
@inproceedings{mubarak2021arabic,
  author = {Hamdy Mubarak and Ammar Rashed and Kareem Darwish and Younes Samih and Ahmed Abdelali},
  title = {{Arabic Offensive Language on Twitter: Analysis and Experiments}},
  booktitle = {Wanlp},
  year = {2021},
}
Figure