File size: 832 Bytes
2a9e2b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# cardiffnlp/twitter-roberta-base-latest-tweet-emoji

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

```python
from transformers import pipeline
text= "I’m tired of being sick.. it’s been four days dawg"

pipe = pipeline('text-classification', model="cardiffnlp/twitter-roberta-base-latest-tweet-emoji")
pipe(text)
predictions = pipe(text)[0]
predictions = sorted(predictions, key=lambda d: d['score'], reverse=True) 
predictions[:5]
>> [{'label': '😒', 'score': 0.14303581416606903},
 {'label': '😩', 'score': 0.07775110006332397},
 {'label': '😤', 'score': 0.0710175409913063},
 {'label': '😑', 'score': 0.06665993481874466},
 {'label': '😫', 'score': 0.0662984848022461}]
```