Downloads · 30 days
11
2% of all-time downloads
delarosajav95/tw-roberta-base-sentiment-FT
tw-roberta-base-sentiment-FT is a text classification model from delarosajav95. Use it when you need a label for a piece of text. It is set up for transformers.
This model is a fine-tuned version of cardiffnlp/twitter-roberta-base-sentiment on the dataset [Sp1786/multiclass-sentiment-analysis-dataset] (https://huggingface.co/datasets/Sp1786/multiclass-sentiment-analysis-datas…
Downloads · 30 days
11
2% of all-time downloads
All-time downloads
567
Public
Parameters
125M
6.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of cardiffnlp/twitter-roberta-base-sentiment on the dataset [Sp1786/multiclass-sentiment-analysis-dataset] (https://huggingface.co/datasets/Sp1786/multiclass-sentiment-analysis-dataset).
The text classification task in this model is based on 3 sentiment labels.
from transformers import pipeline
pipe = pipeline(model="delarosajav95/tw-roberta-base-sentiment-FT")
inputs = ["The flat is very nice but it's too expensive and the location is very bad.",
"I loved the music, but the crowd was too rowdy to enjoy it properly.",
"They believe that I'm stupid and I like waiting for hours in line to buy a simple coffee."
]
result = pipe(inputs, return_all_scores=True)
label_mapping = {"LABEL_0": "Negative", "LABEL_1": "Neutral", "LABEL_2": "Positive"}
for i, predictions in enumerate(result):
print("==================================")
print(f"Text {i + 1}: {inputs[i]}")
for pred in predictions:
label = label_mapping.get(pred['label'], pred['label'])
score = pred['score']
print(f"{label}: {score:.2%}")
Output:
==================================
Text 1: The flat is very nice but it's too expensive and the location is very bad.
Negative: 0.09%
Neutral: 99.88%
Positive: 0.03%
==================================
Text 2: I loved the music, but the crowd was too rowdy to enjoy it properly.
Negative: 0.04%
Neutral: 99.92%
Positive: 0.04%
==================================
Text 3: They believe that I'm stupid and I like waiting for hours in line to buy a simple coffee.
Negative: 69.79%
Neutral: 30.12%
Positive: 0.09%
It achieves the following results on the evaluation set:
The following hyperparameters were used during training:
@inproceedings{barbieri-etal-2020-tweeteval,
title = "{T}weet{E}val: Unified Benchmark and Comparative Evaluation for Tweet Classification",
author = "Barbieri, Francesco and
Camacho-Collados, Jose and
Espinosa Anke, Luis and
Neves, Leonardo",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2020",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.findings-emnlp.148",
doi = "10.18653/v1/2020.findings-emnlp.148",
pages = "1644--1650"
}