Downloads · 30 days
10
0% of all-time downloads
NLP-LTU/distilbert-sexism-detector
distilbert-sexism-detector is a text classification model from NLP-LTU. Use it when you need a label for a piece of text. It is set up for transformers.
This is a fine-tuned model of distilbert-base on the Explainable Detection of Online Sexism (EDOS) dataset. It is intended to be used as a classification model for identifying tweets (0 - not sexist; 1 - sexist).
Downloads · 30 days
10
0% of all-time downloads
All-time downloads
25.2K
Public
Repo size
536 MB
Likes
5
Public
Click a slice to open those files.
.bin268 MB · 100%
From the Hugging Face model README
This is a fine-tuned model of distilbert-base on the Explainable Detection of Online Sexism (EDOS) dataset. It is intended to be used as a classification model for identifying tweets (0 - not sexist; 1 - sexist).
This is a light model with an 81.2 F1 score. Use this model for fase prediction using the online API, if you like to see our best model with 86.3 F1 score , use this link.
Classification examples (use these example in the Hosted Inference API in the right panel ):
| Prediction | Tweet |
|---|---|
| sexist | Every woman wants to be a model. It's codeword for "I get everything for free and people want me" |
| not sexist | basically I placed more value on her than I should then? |
For more details about the datasets and eval results, see (we will updated the page with our paper link)
from transformers import AutoModelForSequenceClassification, AutoTokenizer,pipeline
import torch
model = AutoModelForSequenceClassification.from_pretrained('NLP-LTU/distilbert-sexism-detector')
tokenizer = AutoTokenizer.from_pretrained('distilbert-base-uncased')
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
prediction=classifier("Every woman wants to be a model. It's codeword for 'I get everything for free and people want me' ")
label_pred = 'not sexist' if prediction == 0 else 'sexist'
print(label_pred)
precision recall f1-score support
not sexsit 0.9000 0.9264 0.9130 3030
sexist 0.7469 0.6784 0.7110 970
accuracy 0.8662 4000
macro avg 0.8234 0.8024 0.8120 4000
weighted avg 0.8628 0.8662 0.8640 4000