Views
No views yet
| 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? |
1from transformers import AutoModelForSequenceClassification, AutoTokenizer,pipeline
2import torch
3model = AutoModelForSequenceClassification.from_pretrained('NLP-LTU/bertweet-large-sexism-detector')
4tokenizer = AutoTokenizer.from_pretrained('NLP-LTU/bertweet-large-sexism-detector')
5classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
6prediction=classifier("Every woman wants to be a model. It's codeword for 'I get everything for free and people want me' ")
7# label_pred = 'not sexist' if prediction == 0 else 'sexist'
8
9print(prediction) precision recall f1-score support
not sexsit 0.9355 0.9284 0.9319 3030
sexist 0.7815 0.8000 0.7906 970
accuracy 0.8972 4000
macro avg 0.8585 0.8642 0.8613 4000
weighted avg 0.8981 0.8972 0.8977 4000