Downloads · 30 days
9.9K
1% of all-time downloads
citizenlab/twitter-xlm-roberta-base-sentiment-finetunned
twitter-xlm-roberta-base-sentiment-finetunned is a text classification model from citizenlab. Use it when you need a label for a piece of text. It is set up for transformers.
This is multilingual XLM-Roberta model sequence classifier fine tunned and based on Cardiff NLP Group sentiment classification model.
Downloads · 30 days
9.9K
1% of all-time downloads
All-time downloads
1M
Public
Repo size
2.2 GB
Likes
42
Public
Click a slice to open those files.
.bin1.1 GB · 99%
From the Hugging Face model README
This is multilingual XLM-Roberta model sequence classifier fine tunned and based on Cardiff NLP Group sentiment classification model.
from transformers import pipeline
model_path = "citizenlab/twitter-xlm-roberta-base-sentiment-finetunned"
sentiment_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
sentiment_classifier("this is a lovely message")
> [{'label': 'Positive', 'score': 0.9918450713157654}]
sentiment_classifier("you are an idiot and you and your family should go back to your country")
> [{'label': 'Negative', 'score': 0.9849833846092224}]
precision recall f1-score support
Negative 0.57 0.14 0.23 28
Neutral 0.78 0.94 0.86 132
Positive 0.89 0.80 0.85 51
accuracy 0.80 211
macro avg 0.75 0.63 0.64 211
weighted avg 0.78 0.80 0.77 211