Skip to main content
QUICK REVIEW

[Paper Review] Detecting Hate Speech in Social Media

Shervin Malmasi, Marcos Zampieri|arXiv (Cornell University)|Dec 18, 2017
Hate Speech and Cyberbullying DetectionComputer Science18 references33 citations
TL;DR

This paper establishes a lexical baseline for detecting hate speech in social media by applying supervised classification using character n-grams, word n-grams, and skip-grams on a three-class Twitter dataset (hate speech, offensive language, non-offensive). The best-performing model, using character 4-grams with a linear SVM, achieved 78% accuracy, highlighting that distinguishing hate speech from general profanity remains a major challenge due to significant class confusion.

ABSTRACT

In this paper we examine methods to detect hate speech in social media, while distinguishing this from general profanity. We aim to establish lexical baselines for this task by applying supervised classification methods using a recently released dataset annotated for this purpose. As features, our system uses character n-grams, word n-grams and word skip-grams. We obtain results of 78% accuracy in identifying posts across three classes. Results demonstrate that the main challenge lies in discriminating profanity and hate speech from each other. A number of directions for future work are discussed.

Motivation & Objective

  • To establish a lexical baseline for hate speech detection in social media, particularly distinguishing it from general profanity.
  • To evaluate the performance of various n-gram and clustering features in a multi-class classification setting.
  • To identify the core challenges in differentiating hate speech from offensive but non-hateful content.
  • To provide a foundation for future work by analyzing feature importance and misclassification patterns in the Hate Speech Detection dataset.

Proposed method

  • A linear Support Vector Machine (SVM) classifier was used for multi-class text classification on a three-class Twitter dataset.
  • Features included character n-grams (up to 4-grams), word n-grams (up to 2-grams), word skip-grams (up to 2-grams), and Brown word clusters.
  • The dataset was preprocessed by converting text to lowercase and removing URLs and emojis.
  • Model training and evaluation used 10-fold cross-validation with stratified sampling to handle class imbalance.
  • Learning curves were plotted to assess performance as a function of training data size.
  • Confusion matrices were generated to analyze misclassification patterns, particularly between hate speech and offensive language classes.

Experimental results

Research questions

  • RQ1How well can lexical features alone distinguish hate speech from offensive language and non-offensive content in social media texts?
  • RQ2What is the performance of different n-gram and clustering features in a multi-class hate speech detection task?
  • RQ3To what extent is the confusion between hate speech and offensive language driven by overlapping lexical content?
  • RQ4How does class imbalance affect model performance, and does increasing training data improve accuracy?
  • RQ5What are the most informative features for each of the three classes, and how do they relate to semantic and stylistic cues?

Key findings

  • The character 4-gram model achieved the highest accuracy of 78%, outperforming other feature types.
  • The Hate class was the most difficult to classify, with high confusion rates from the Offensive class.
  • A substantial portion of Offensive content was misclassified as non-offensive, indicating poor detection of general offensiveness.
  • The non-offensive (Ok) class achieved the best classification performance, with most examples correctly identified.
  • Learning curves showed that accuracy increased steadily with more training data, though at a diminishing rate beyond 15,000 instances.
  • Feature analysis revealed that coarse and obscene words were highly informative for both Hate and Offensive classes, while grammatical words were prominent in the most informative features for the Ok class.

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.