Downloads · 30 days
19
7% of all-time downloads
Sheshank2609/content-moderation-distilbert
content-moderation-distilbert is a text classification model from Sheshank2609. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is based on DistilBERT and fine-tuned on the Jigsaw Toxic Comment Classification dataset for multi-label content moderation. It can detect multiple forms of toxic or harmful language in English comments, in…
Downloads · 30 days
19
7% of all-time downloads
All-time downloads
265
Public
Parameters
67M
5.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.pt3.8 GB · 64%
From the Hugging Face model README
This model is based on DistilBERT and fine-tuned on the Jigsaw Toxic Comment Classification dataset for multi-label content moderation.
It can detect multiple forms of toxic or harmful language in English comments, including:
DistilBERT is a smaller, faster version of BERT while retaining most of its performance, making it suitable for real-time moderation tasks.
⚠️ Not for production without further evaluation. Models may misclassify sarcasm, slang, or subtle harassment. Always use human moderators for critical cases.
distilbert-base-uncasedValidation performance (held-out split):
✅ Strong at detecting direct insults and threats.
⚠️ Struggles with sarcasm or subtle negativity.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="your-username/content-moderation-distilbert",
tokenizer="your-username/content-moderation-distilbert",
return_all_scores=True,
function_to_apply="sigmoid" # multi-label classification
)
texts = [
"You are an amazing person and I respect you.",
"I hate you, you are disgusting!",
"I will not kill you tomorrow"
]
for t in texts:
preds = classifier(t)
print(f"\nInput: {t}")
for label in preds[0]:
print(f"{label['label']}: {label['score']:.3f}")