Downloads · 30 days
21
100% of all-time downloads
yhile-com/yhile-toxic-lr-v1
yhile-toxic-lr-v1 is a text classification model from yhile-com. Use it when you need a label for a piece of text. The card lists the license as cc-by-sa-3.0.
A logistic regression classifier that predicts whether text is hate speech, offensive, or neither. Built with scikit-learn using TF-IDF text features combined with hand-engineered structural features targeting identit…
Downloads · 30 days
21
100% of all-time downloads
All-time downloads
21
Public
Repo size
11.5 MB
Likes
1
Public
Click a slice to open those files.
.skops11.5 MB · 100%
From the Hugging Face model README
A logistic regression classifier that predicts whether text is hate speech, offensive, or neither. Built with scikit-learn using TF-IDF text features combined with hand-engineered structural features targeting identity-based exclusion language.
This README was written with AI assistance.
| Source | Rows (approx.) | License |
|---|---|---|
| Davidson et al. Hate Speech and Offensive Language | 24,783 | No formal license; standard, widely-used public research dataset |
| Stormfront hate speech dataset (de Gibert et al., Vicomtech) | 10,534 | CC-BY-SA 3.0 (Spain) |
| Wikipedia Talk Labels: Toxicity (Wulczyn, Thain, Dixon) | 158,839 | CC0 (public domain) |
| Handcrafted examples | ~35 | Written to teach identity-based exclusion patterns not well represented in the public data, and to prevent the model from treating identity mentions themselves as a hate signal |
Final combined dataset: ~194,000 rows. Class balance: ~79% neither, ~19% offensive, ~1.4% hate — hate speech is a genuine minority class in all three source datasets.
Licensing note: the Stormfront dataset is licensed CC-BY-SA 3.0, a share-alike license. Because this trained model incorporates that data, this repository is released under the same CC-BY-SA 3.0 license rather than MIT, to respect the share-alike requirement of the source data.
Evaluated on a held-out 20% stratified test split (~38,840 rows):
from skops.io import load, get_untrusted_types
untrusted = get_untrusted_types(file="yhile-toxic-lr-v1.skops")
saved = load("yhile-toxic-lr-v1.skops", trusted=untrusted)
model = saved["model"]
word_vectorizer = saved["word_vectorizer"]
char_vectorizer = saved["char_vectorizer"]
label_names = saved["label_names"] # {0: "hate", 1: "offensive", 2: "neither"}
# see train.py for the full extract_features() implementation used at
# both training and inference time — the two must stay in sync
The full training pipeline and feature engineering are included as
train.py in this repository for transparency.
This model has real, tested limitations — documented here rather than glossed over:
The Stormfront dataset consists of sentences from an actual white supremacist forum, sampled and labeled for research purposes to help build counter-hate-speech tools. The Wikipedia dataset contains real, sometimes-hostile comments from actual Wikipedia editors. Both are used here for their stated research purpose: building tools to detect and reduce hateful and toxic content, not to reproduce or endorse it.
If you use this model or its training data, please cite the original dataset authors:
Davidson, T., Warmsley, D., Macy, M., Weber, I. Automated Hate Speech Detection and the Problem of Offensive Language. ICWSM 2017.
de Gibert, O., Perez, N., García-Pablos, A., Cuadros, M. Hate Speech Dataset from a White Supremacy Forum. ALW2, 2018.
Wulczyn, E., Thain, N., Dixon, L. Ex Machina: Personal Attacks Seen at Scale. WWW 2017.