How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="citizenlab/distilbert-base-multilingual-cased-toxicity")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("citizenlab/distilbert-base-multilingual-cased-toxicity")
model = AutoModelForSequenceClassification.from_pretrained("citizenlab/distilbert-base-multilingual-cased-toxicity", device_map="auto")
Quick Links

citizenlab/distilbert-base-multilingual-cased-toxicity

This is multilingual Distil-Bert model sequence classifier trained based on JIGSAW Toxic Comment Classification Challenge dataset.

How to use it

from transformers import pipeline

model_path = "citizenlab/distilbert-base-multilingual-cased-toxicity"

toxicity_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
toxicity_classifier("this is a lovely message")
> [{'label': 'not_toxic', 'score': 0.9954179525375366}]

toxicity_classifier("you are an idiot and you and your family should go back to your country")
> [{'label': 'toxic', 'score': 0.9948776960372925}]

Evaluation

Accuracy

  Accuracy Score = 0.9425
F1 Score (Micro) = 0.9450549450549449
F1 Score (Macro) = 0.8491432341169309
Downloads last month
3,992
Inference Providers NEW

Model tree for citizenlab/distilbert-base-multilingual-cased-toxicity

Adapters
4 models
Quantizations
1 model

Dataset used to train citizenlab/distilbert-base-multilingual-cased-toxicity

Spaces using citizenlab/distilbert-base-multilingual-cased-toxicity 9