yhile-toxic-lr-v1
Hate speech and toxicity classifier
About
yhile-toxic-lr-v1 sorts text into three classes: hate speech, offensive, or neither. It is a scikit-learn logistic regression model over TF-IDF word and character n-grams, plus hand-built signals for identity terms, exclusionary language, and dehumanizing language.
Intended use
Detecting hate speech and toxic content in English text, especially patterns that pair identity terms with exclusionary language. Treat the output as a first-pass signal that a person reviews.
Limitations
Hate speech precision is low (0.22), which works out to roughly three false positives for every true positive, so do not use it to act automatically on people or content. Hate speech without explicit identity words, diminishment-based patterns such as some forms of misogyny, and sarcasm are often missed. The training labels contain contested distinctions, and the model has not been evaluated on live moderation traffic. English only.
Demo
Runs entirely in your browser. What you type is never uploaded or stored.
We do not support hate speech. This model is a demo of a detector, and it can be wrong: it may flag harmless text and miss harmful text (hate speech precision is 0.22 on the test set). Treat the result as a hint for a person to check, not a verdict. English only.
Demo coming soon.
Details
| Architecture | Multiclass logistic regression (scikit-learn) on TF-IDF word 1-2-grams (10,000 features) and character 3-5-grams (5,000 features), plus engineered identity, exclusion, and dehumanization signals. Saved with skops. |
|---|---|
| Training data | About 194,000 rows: Davidson et al. hate speech dataset (about 24,783), Stormfront hate speech dataset (about 10,534), Wikipedia Talk Labels: Toxicity (about 158,839), and about 35 handcrafted examples. Class balance: about 79% neither, 19% offensive, 1.4% hate. |
| Metrics | On a 20% held-out test split (about 38,840 rows): overall accuracy 91.1%. Precision / recall: neither 0.97 / 0.93, offensive 0.81 / 0.84, hate 0.22 / 0.63. |
| License | CC-BY-SA 3.0 (inherited from the Stormfront dataset) |
| File size | 11.5 MB (yhile-toxic-lr-v1.skops) |