Downloads · 30 days
151
0% of all-time downloads
fti-sc/roberta_toxicity_classifier
roberta_toxicity_classifier is a machine learning model from fti-sc. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is trained for toxicity classification task. The dataset used for training is the merge of the English parts of the three datasets by Jigsaw (Jigsaw 2018, Jigsaw 2019, Jigsaw 2020), containing around 2 mill…
Downloads · 30 days
151
0% of all-time downloads
All-time downloads
109K
Public
Repo size
501 MB
Likes
0
Public
Click a slice to open those files.
.bin501 MB · 100%
From the Hugging Face model README
This model is trained for toxicity classification task. The dataset used for training is the merge of the English parts of the three datasets by Jigsaw (Jigsaw 2018, Jigsaw 2019, Jigsaw 2020), containing around 2 million examples. We split it into two parts and fine-tune a RoBERTa model (RoBERTa: A Robustly Optimized BERT Pretraining Approach) on it. The classifiers perform closely on the test set of the first Jigsaw competition, reaching the AUC-ROC of 0.98 and F1-score of 0.76.
from transformers import RobertaTokenizer, RobertaForSequenceClassification
# load tokenizer and model weights
tokenizer = RobertaTokenizer.from_pretrained('SkolkovoInstitute/roberta_toxicity_classifier')
model = RobertaForSequenceClassification.from_pretrained('SkolkovoInstitute/roberta_toxicity_classifier')
# prepare the input
batch = tokenizer.encode('you are amazing', return_tensors='pt')
# inference
model(batch)
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.