hate-speech-offensive-language-eval
Automated Hate Speech Detection and the Problem of Offensive Language — Davidson et al. (2017) (arXiv:1703.04009, 2017)
What this evaluates
Evaluates a model's ability to distinguish between hate speech, offensive language, and neutral text in social media posts. It probes the classifier's sensitivity to contextual nuances, reclaimed slurs, and demographic-specific biases in labeling.
Datasets
Metrics
F1 score (primary) — range: [0, 1]
- Harmonic mean of precision and recall: 2 * (precision * recall) / (precision + recall). Reported as the overall macro-average across the three classes (hate speech, offensive language, neither).
precision — range: [0, 1]
- Ratio of correctly predicted positive instances to the total predicted positives for each class.
recall — range: [0, 1]
- Ratio of correctly predicted positive instances to the total actual positives for each class.
Input / output format
Input: Raw tweet text (string).
Output: One of three discrete class labels: 'hate speech', 'offensive language', or 'neither'.
Scoring recipe
def compute_metrics(preds, golds):
from sklearn.metrics import precision_recall_fscore_support
prec, rec, f1, _ = precision_recall_fscore_support(golds, preds, average='macro')
return {'precision': prec, 'recall': rec, 'f1': f1}
Common pitfalls
- Contextual ambiguity: reclaimed slurs (e.g., 'n*gga') or positive uses of stigmatized terms (e.g., 'gay', 'queer') are often misclassified as hate speech due to lexical bias.
- Sexist language is frequently labeled as 'offensive' rather than 'hate speech' by human coders, creating a systematic class imbalance and evaluation bias.
- Amateur crowd-sourced labels are noisy; coders often skim tweets, leading to mislabeling of borderline or context-dependent cases.
Evidence (verbatim from paper)
The best performing model has an overall precision 0.91, recall of 0.90, and F1 score of 0.90. Looking at Figure 1, however, we see that almost 40% of hate speech is misclassified: the precision and recall scores for the hate class are 0.44 and 0.61 respectively.
Citation
@misc{davidson2017automated,
title={Automated Hate Speech Detection and the Problem of Offensive Language},
author={Davidson et al. (2017)},
year={2017},
note={arXiv:1703.04009}
}
1---2name: hate-speech-offensive-language-eval3description: Evaluates a model's ability to distinguish between hate speech, offensive language, and neutral text in social media posts. It probes the classifier's sensitivity to contextual nuances, reclaimed slurs, and demographic-specific biases in labeling. Use when the user wants to benchmark on Hate Speech and Offensive Language Dataset, or asks about evaluating this task. Reports F1 score.4---56# hate-speech-offensive-language-eval78> Automated Hate Speech Detection and the Problem of Offensive Language — Davidson et al. (2017) (arXiv:1703.04009, 2017)910## What this evaluates1112Evaluates a model's ability to distinguish between hate speech, offensive language, and neutral text in social media posts. It probes the classifier's sensitivity to contextual nuances, reclaimed slurs, and demographic-specific biases in labeling.1314## Datasets1516- **Hate Speech and Offensive Language Dataset** — total ?; splits: test (-1); repo https://github.com/t-davidson/hate-speech-and-offensive-language1718## Metrics1920- `F1 score` **(primary)** — range: [0, 1]21 - Harmonic mean of precision and recall: 2 * (precision * recall) / (precision + recall). Reported as the overall macro-average across the three classes (hate speech, offensive language, neither).22- `precision` — range: [0, 1]23 - Ratio of correctly predicted positive instances to the total predicted positives for each class.24- `recall` — range: [0, 1]25 - Ratio of correctly predicted positive instances to the total actual positives for each class.2627## Input / output format2829**Input**: Raw tweet text (string).3031**Output**: One of three discrete class labels: 'hate speech', 'offensive language', or 'neither'.3233## Scoring recipe3435```python36def compute_metrics(preds, golds):37 from sklearn.metrics import precision_recall_fscore_support38 prec, rec, f1, _ = precision_recall_fscore_support(golds, preds, average='macro')39 return {'precision': prec, 'recall': rec, 'f1': f1}40```4142## Common pitfalls4344- Contextual ambiguity: reclaimed slurs (e.g., 'n*gga') or positive uses of stigmatized terms (e.g., 'gay', 'queer') are often misclassified as hate speech due to lexical bias.45- Sexist language is frequently labeled as 'offensive' rather than 'hate speech' by human coders, creating a systematic class imbalance and evaluation bias.46- Amateur crowd-sourced labels are noisy; coders often skim tweets, leading to mislabeling of borderline or context-dependent cases.4748## Evidence (verbatim from paper)4950> The best performing model has an overall precision 0.91, recall of 0.90, and F1 score of 0.90. Looking at Figure 1, however, we see that almost 40% of hate speech is misclassified: the precision and recall scores for the hate class are 0.44 and 0.61 respectively.5152## Citation5354```bibtex55@misc{davidson2017automated,56 title={Automated Hate Speech Detection and the Problem of Offensive Language},57 author={Davidson et al. (2017)},58 year={2017},59 note={arXiv:1703.04009}60}61```6263- arXiv: 1703.04009