Skip to main content
QUICK REVIEW

[Paper Review] An Exploration of State-of-the-art Methods for Offensive Language Detection

Harrison Uglow, Martin Zlocha|arXiv (Cornell University)|Mar 15, 2019
Hate Speech and Cyberbullying DetectionComputer Science9 references7 citations
TL;DR

This paper evaluates state-of-the-art methods for offensive language detection on the OLID dataset, comparing traditional feature engineering with deep learning models. It finds that BERT and fine-tuned FastText outperform CNNs and LSTMs, with BERT achieving the highest macro F1 score of 0.786 on the test set for Task A (offensive language detection), while simple feature fusion also performs strongly.

ABSTRACT

We provide a comprehensive investigation of different custom and off-the-shelf architectures as well as different approaches to generating feature vectors for offensive language detection. We also show that these approaches work well on small and noisy datasets such as on the Offensive Language Identification Dataset (OLID), so it should be possible to use them for other applications.

Motivation & Objective

  • To evaluate the effectiveness of various feature engineering and deep learning approaches for offensive language detection on small, noisy datasets like OLID.
  • To compare traditional machine learning models (e.g., Random Forest, Logistic Regression) with end-to-end deep learning architectures (CNN, LSTM, BERT, FastText).
  • To investigate whether pre-trained word embeddings (Word2Vec, FastText) generalize well to tweet-level offensive language detection.
  • To determine the impact of hyperparameter tuning and model architecture on performance across three subtasks: offensive classification, targeted vs. non-targeted offense, and target identification.
  • To identify the most robust and generalizable model for offensive language detection in low-resource, noisy settings.

Proposed method

  • Used the OLID dataset with three subtasks: offensive classification (Task A), targeted vs. non-targeted offense (Task B), and target identification (individual vs. group) (Task C).
  • Preprocessed tweets by normalizing case, expanding contractions, removing non-alphanumeric characters (except punctuation), and replacing usernames/URLs with placeholders.
  • Generated naive feature vectors based on counts of hate, positive, and negative words, and their normalized versions by tweet length.
  • Trained Word2Vec embeddings on the training data and experimented with averaging, max-pooling, and other aggregation methods to create sentence-level vectors.
  • Implemented a CNN with 3 parallel convolutional layers (filter sizes 3, 4, 5), max-pooling, dropout, and a softmax output layer, using trainable embeddings.
  • Built an LSTM model with a similar architecture to the CNN but replaced max-pooling with a bidirectional LSTM layer after convolutions, and used early stopping based on validation F1.
  • Fine-tuned FastText and BERT models using random search over hyperparameters (learning rate, epochs, n-gram size, vector dimensions), avoiding pre-trained vectors due to domain mismatch.
  • Evaluated models using macro F1 scores on validation and test sets, with early stopping and model selection based on validation performance.

Experimental results

Research questions

  • RQ1How do hand-crafted feature vectors (e.g., word counts) compare to learned embeddings (e.g., Word2Vec) in offensive language detection on small, noisy datasets?
  • RQ2To what extent do traditional machine learning models (e.g., Random Forest, Logistic Regression) with engineered features outperform end-to-end deep learning models like CNNs and LSTMs?
  • RQ3How effective are pre-trained word embeddings (e.g., from Wikipedia) for offensive language detection in social media text, given domain shift?
  • RQ4Which deep learning architecture—CNN, LSTM, FastText, or BERT—generalizes best to the test set across all three offensive language detection subtasks?
  • RQ5Does extensive hyperparameter tuning on validation data lead to overfitting, especially in models like FastText that are fast to train?

Key findings

  • BERT achieved the highest macro F1 score on the test set for Task A (offensive language detection) at 0.786, outperforming all other models.
  • FastText achieved a macro F1 of 0.687 on Task B (targeted vs. non-targeted offense) and 0.561 on Task C (target identification), indicating strong performance on targeted offense detection.
  • The CNN model achieved a test F1 of 0.735 on Task A, 0.470 on Task B, and 0.457 on Task C, showing moderate performance but failing to generalize on Task B.
  • The LSTM model underperformed compared to CNN, with a test F1 of 0.753 on Task A but only 0.330 on Task B, indicating poor learning on the targeted offense subtask.
  • Combining naive features (word counts) with Word2Vec embeddings improved performance over either method alone, with the best result (F1 0.668) achieved by the StackingCVClassifier.
  • FastText performed better on the validation set than on the test set (F1 0.785 vs. 0.707 on Task A), suggesting overfitting due to extensive hyperparameter tuning on the validation set.

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.