Locate the Hate: Detecting Tweets against Blacks

Irene Kwok, Yuzhou WangAAAI 2013 · DOI

Abstract

As social media platforms became central hubs for public discourse in the early 2010s, the proliferation of hate speech emerged as a significant challenge for automated moderation. This paper investigates the efficacy of a supervised machine learning approach to identify anti-Black hate speech on Twitter. Utilizing a Naïve Bayes classifier on a dataset of over 24,000 tweets, the study achieves a 76% accuracy rate. However, the findings reveal a profound "subjectivity gap" in human perception of hate speech and highlight the critical role of linguistic context—specifically the reappropriation of slurs within the Black Twitter community—which poses a significant hurdle for simple keyword-based detection models.

Introduction

By 2013, Twitter had established itself as a primary communication tool, particularly for Black users, who represented approximately 25% of the platform's active population. Despite this high engagement, research into the automated detection of anti-Black sentiment remained sparse. The instantaneous nature of microblogging, combined with features like retweeting, acts as a force multiplier for racial harassment.

The challenge of moderating this content lies in the sheer volume of data—half a billion tweets per day—and the inherent nuance of human language. Hate speech is rarely uniform; it ranges from overt slurs to subtle jokes and coded language. This study seeks to establish whether a relatively simple probabilistic model can reliably distinguish between racist and non-racist content in this high-velocity environment.

Methodology

The researchers employed a Naïve Bayes classifier, a standard probabilistic model for text classification known for its efficiency with high-dimensional data. The experimental pipeline consisted of four primary stages:

  1. Preprocessing: To reduce noise, the researchers removed URLs, user mentions, stopwords, and punctuation.
  2. Normalization: Text was lowercased, and various alternative spellings of common slurs were mapped to a single "properly spelled" equivalent to consolidate features and improve model density.
  3. Feature Extraction: The model utilized a unigram (bag-of-words) approach, resulting in a vocabulary of 9,437 unique words from the racist dataset and 8,401 from the non-racist dataset.
  4. Validation: The model’s robustness was evaluated using 10-fold cross-validation.

Prior to model training, the researchers conducted a human baseline study. Three students of different racial backgrounds classified a subset of 100 tweets containing common hate-speech keywords. Agreement among these human coders was measured using Fleiss’ Kappa.

Data Collection

The study utilized a balanced training dataset of 24,582 tweets, categorized as follows:

  • Racist Dataset: Sourced from accounts that either self-identified as racist or were identified by news organizations as primary sources of anti-Black sentiment (with a specific focus on anti-Obama rhetoric prevalent at the time).
  • Non-racist Dataset: Collected by searching for keywords found in the racist dataset but filtering for contexts that were clearly non-hateful, such as discussions within the "Black Twitter" community.

Key Insights and Discussion

The Subjectivity Gap

The human baseline study revealed a startling lack of consensus: the overall agreement rate among human coders was only 33%. This suggests that hate speech is deeply subjective and context-dependent. If humans struggle to agree on what constitutes an offensive tweet, automated systems face an inherent "ceiling" of accuracy based on the ambiguity of the training labels.

The "N-Word" Dichotomy and Identity

The most significant linguistic finding involved the use of the "N-word." The researchers observed a sharp divide: the version of the slur ending in "-er" appeared over 5,000 times in the racist dataset. In contrast, the version ending in "-a" appeared almost exclusively in the non-racist dataset, often used as a term of endearment or a neutral synonym within the Black community. This underscores that identity serves as metadata; the meaning of a word is often dictated by the speaker's identity and intent rather than the word itself.

The Failure of Unigrams

While the model performed well on overt racism, it struggled with "subtle" racism. Because the unigram approach treats words in isolation, it cannot capture the meaning of racist jokes that use innocuous words to create a hateful message through context. For example, a model might flag a neutral sentence like "The black car is filthy" as racist simply because it contains the words "black" and "filthy," while missing a complex racist trope that uses no slurs at all.

Results

The Naïve Bayes classifier achieved an average accuracy of 76%. Analysis of the errors (a 24% error rate) showed that 86% of tweets correctly labeled as racist were identified primarily due to the presence of specific offensive keywords. This confirms that while keywords are strong indicators, they leave a 14% gap of "subtle" racism that unigram models are fundamentally unable to detect.

Conclusion and Future Work

The study concludes that while a "bag-of-words" model provides a useful baseline for detecting overt hate speech, it is insufficient for the complexities of social media discourse. Future work must move beyond unigrams to incorporate:

  • Bigrams and Sentiment Analysis: To capture the relationship between words and the emotional tone of the tweet.
  • Speaker Identity: To correctly interpret reappropriated language and distinguish between hate speech and community-internal dialogue.
  • Evolving Tactics: To account for deliberate misspellings and the use of hashtags to mask or amplify hateful intent.

Ultimately, detecting hate speech is as much a social and linguistic problem as it is a computational one. Effective moderation requires models that understand not just what is being said, but who is saying it and in what context.

Summary updated

BibTeX
@inproceedings{kwok2013locate,
  author = {Irene Kwok and Yuzhou Wang},
  title = {{Locate the Hate: Detecting Tweets against Blacks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2013},
  doi = {10.1609/aaai.v27i1.8539},
}
Figure