TL;DR
This paper introduces HaT5, a novel approach for hate speech detection that leverages the T5 text-to-text transformer architecture. By augmenting training data and performing a thorough analysis of existing datasets and models, HaT5 achieves near state-of-the-art performance on challenging hate speech identification tasks, while also highlighting critical issues with data annotation quality.
What Problem Does This Paper Address?
Hate speech on social media platforms is a pervasive and harmful issue, necessitating effective automated detection methods. While significant progress has been made with deep learning models, accurately identifying hate speech, especially implicit forms, remains a challenge. Existing datasets and models often struggle with nuances, leading to misclassifications. This paper aims to improve hate speech detection by investigating the performance of the T5 transformer architecture, exploring data augmentation techniques, and critically analyzing the quality of existing hate speech datasets.
Methods
The core of this work is the application and adaptation of the T5 (Text-to-Text Transfer Transformer) model for hate speech identification. The authors compare T5 against other state-of-the-art (SoTA) architectures, including Bi-LSTM, CNN, and RoBERTa.
Key methodological contributions include:
- Data Augmentation: The researchers employed an autoregressive model (fine-tuned DialoGPT) to generate synthetic training data, significantly increasing the dataset size and aiming to improve model robustness.
- Error Analysis with Integrated Gradients (IG): To understand model behavior, particularly for misclassifications, the authors utilized Integrated Gradients. This technique attributes the model's predictions to specific words in the input text, providing insights into why certain tweets are flagged or missed.
- Task Prefixing: For the T5 model, a "classification" task prefix was used to guide the model's output for the specific hate speech identification tasks.
Datasets
The study utilizes two publicly available datasets for hate speech and offensive language identification:
- HASOC 2021 (Hate Speech and Offensive Content Identification): This dataset contains tweets related to the Covid-19 pandemic and includes two tasks:
- Task A: Identifying hate speech and offensive text.
-
Task B: Categorizing hateful and offensive content into "HATE," "OFFN" (offensive), or "PRFN" (profane). The English dataset consists of 3,843 training samples and 1,281 test samples.
-
OLID (OffensEval 2019): This dataset, derived from Twitter, encompasses three subtasks:
- a) Offensive language detection.
- b) Categorization of offensive language as targeted at an individual/group or not.
- c) Offensive language target identification. The dataset contains 14,200 annotated English tweets.
For evaluation, 10% of the training set was used as a development (dev) set for each dataset.
Key Insights and Ideas
- T5's Dominance: The T5 model consistently outperformed Bi-LSTM, CNN, and RoBERTa across most tasks, demonstrating its strong capabilities in text-to-text transfer for this domain.
- Data Augmentation Pays Off: Augmenting the HASOC dataset with synthetic data led to noticeable performance improvements, particularly for Task A, pushing the results closer to SoTA.
- Data Quality is Crucial: The paper strongly emphasizes the impact of data annotation quality. They identified instances in the HASOC 2021 test set where the ground truth labels appeared incorrect, yet the T5 model made the correct prediction, suggesting that human annotators can sometimes be less accurate than a well-trained model.
- Bi-LSTM's Weaknesses Revealed: Through Integrated Gradients, the authors visualized how Bi-LSTM struggled with certain nuances, sometimes being misled by hashtags or misinterpreting context, especially when dealing with implicitly offensive content or when training data distribution favored certain classifications.
Key Results
- Near SoTA Performance: The HaT5 model (T5 with augmented data) achieved macro F1 scores of 83.0% on Task A of HASOC 2021 and 81.66% on Task A of OLID 2019, very close to the reported SoTA scores of 83.05% and 82.9% respectively.
- T5 Outperforms Others: T5 consistently achieved higher weighted and macro F1 scores than Bi-LSTM, CNN, and RoBERTa on both OLID and HASOC datasets.
- Error Analysis Findings: On the HASOC 2021 test set, the T5 model misclassified 33.13% of 'NOT' (not offensive) instances, while only misclassifying 7.52% of 'HOF' (hate or offensive) instances. This imbalance is attributed to the training data having more 'HOF' samples.
Limitations and Future Work
- Hyperparameter Tuning: The authors acknowledge that they had limited time for extensive hyperparameter tuning, suggesting that further optimization could lead to even better results.
- Data Annotation Issues: The paper highlights the significant impact of potentially flawed data annotations on model evaluation and performance, suggesting a need for more robust annotation processes.
- Future Directions:
- Exploring voting ensemble methods for potentially improved performance, while noting the risk of weak model votes.
- Investigating cross-domain or zero-shot inference to enhance model generalization.
- Studying the performance of models on raw data without preprocessing, as some offensive messages might rely on emojis or special characters.
- The authors also plan to release their model checkpoints on the HuggingFace hub to foster transparency.
Summary updated