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.
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="Void10/distilbert-toxic-en",
6 return_all_scores=True
7)
8
9result = classifier("You are such a wonderful person!")
10# [{'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).
1from transformers import (DistilBertTokenizerFast,
2 DistilBertForSequenceClassification,
3 TrainingArguments, Trainer)
4
5args = TrainingArguments(
6 output_dir="./results",
7 num_train_epochs=3,
8 per_device_train_batch_size=32,
9 per_device_eval_batch_size=64,
10 warmup_steps=200,
11 evaluation_strategy="epoch",
12 fp16=True,
13)
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:
B.Tech Computer Science (AI/ML) · Shivalik College of Engineering · Dehradun, India
Built as a college research minor project · 2026