File size: 826 Bytes
8b38f1d
bdd868c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# cardiffnlp/twitter-roberta-base-latest-tweet-emotion

This is a [RoBERTa-base](https://huggingface.co/cardiffnlp/twitter-roberta-base-2022-154m) model fine-tuned on [tweet-emotion](https://huggingface.co/datasets/cardiffnlp/super_tweeteval).

```python
from transformers import pipeline
text= "@user it also helps that the majority of NFL coaching is inept. Some of Bill O'Brien's play calling was wow, ! #GOPATS"

pipe = pipeline('text-classification', model="cardiffnlp/twitter-roberta-base-latest-tweet-emotion")
predictions = pipe(text)[0]
predictions = [x for x in predictions if x['score'] > 0.5]
predictions
>> [{'label': 'anger', 'score': 0.8713036775588989},
 {'label': 'disgust', 'score': 0.7899409532546997},
 {'label': 'joy', 'score': 0.9664386510848999},
 {'label': 'optimism', 'score': 0.6123248934745789}]
```