Downloads · 30 days
28
27% of all-time downloads
Void10/distilbert-toxic-en
distilbert-toxic-en is a text classification model from Void10. Use it when you need a label for a piece of text. The card lists the license as mit.
Fine-tuned DistilBERT for real-time toxic content detection. Built as a research prototype exploring automated content moderation with a planned extension to Hindi and Hinglish language moderation.
Downloads · 30 days
28
27% of all-time downloads
All-time downloads
104
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
Fine-tuned DistilBERT for real-time toxic content detection. Built as a research prototype exploring automated content moderation with a planned extension to Hindi and Hinglish language moderation.
| Property | Value |
|---|---|
| Base Model | distilbert-base-uncased |
| Task | Binary Text Classification |
| Dataset | SetFit/toxic_conversations |
| Training Samples | 20,000 |
| Epochs | 3 |
| Batch Size | 32 |
| Max Sequence Length | 128 |
| Mixed Precision | fp16 |
| Metric | Score |
|---|---|
| Accuracy | 95.19% |
| Precision | 74.88% |
| Recall | 60.16% |
| F1 Score | 66.72% |
| Avg Inference Latency | 237ms (CPU) |
| Label | Meaning |
|---|---|
| LABEL_0 | Clean — no policy violation detected |
| LABEL_1 | Toxic — abusive, threatening, or harmful content |
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Void10/distilbert-toxic-en",
return_all_scores=True
)
result = classifier("You are such a wonderful person!")
# [{'label': 'LABEL_0', 'score': 0.97}, {'label': 'LABEL_1', 'score': 0.03}]
Fine-tuned on a 20K subsample of the SetFit toxic conversations dataset using HuggingFace Trainer API on a T4 GPU via Google Colab. Labels were binarized from multi-label annotations into clean (0) vs toxic (1).
from transformers import (DistilBertTokenizerFast,
DistilBertForSequenceClassification,
TrainingArguments, Trainer)
args = TrainingArguments(
output_dir="./results",
num_train_epochs=3,
per_device_train_batch_size=32,
per_device_eval_batch_size=64,
warmup_steps=200,
evaluation_strategy="epoch",
fp16=True,
)
The primary limitation of existing content moderation research — including recent work like SLM-Mod (NAACL 2025) — is the exclusive focus on English data. This model serves as the English baseline for a planned multilingual extension targeting:
Try the model live at:
huggingface.co/spaces/Void10/content-moderation-demo
If you use this model in your research, please cite:
B.Tech Computer Science (AI/ML) · Shivalik College of Engineering · Dehradun, India
Built as a college research minor project · 2026