Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# cardiffnlp/twitter-roberta-base-latest-tweet-emoji
|
2 |
+
|
3 |
+
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).
|
4 |
+
|
5 |
+
```python
|
6 |
+
from transformers import pipeline
|
7 |
+
text= "I’m tired of being sick.. it’s been four days dawg"
|
8 |
+
|
9 |
+
pipe = pipeline('text-classification', model="cardiffnlp/twitter-roberta-base-latest-tweet-emoji")
|
10 |
+
pipe(text)
|
11 |
+
predictions = pipe(text)[0]
|
12 |
+
predictions = sorted(predictions, key=lambda d: d['score'], reverse=True)
|
13 |
+
predictions[:5]
|
14 |
+
>> [{'label': '😒', 'score': 0.14303581416606903},
|
15 |
+
{'label': '😩', 'score': 0.07775110006332397},
|
16 |
+
{'label': '😤', 'score': 0.0710175409913063},
|
17 |
+
{'label': '😑', 'score': 0.06665993481874466},
|
18 |
+
{'label': '😫', 'score': 0.0662984848022461}]
|
19 |
+
```
|