Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# cardiffnlp/twitter-roberta-base-latest-tempo-wic
|
2 |
+
|
3 |
+
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).
|
4 |
+
|
5 |
+
```python
|
6 |
+
from transformers import pipeline
|
7 |
+
text= "@user it also helps that the majority of NFL coaching is inept. Some of Bill O'Brien's play calling was wow, ! #GOPATS"
|
8 |
+
|
9 |
+
pipe = pipeline('text-classification', model="cardiffnlp/twitter-roberta-base-latest-tweet-emotion")
|
10 |
+
predictions = pipe(text)[0]
|
11 |
+
predictions = [x for x in predictions if x['score'] > 0.5]
|
12 |
+
predictions
|
13 |
+
>> [{'label': 'anger', 'score': 0.8713036775588989},
|
14 |
+
{'label': 'disgust', 'score': 0.7899409532546997},
|
15 |
+
{'label': 'joy', 'score': 0.9664386510848999},
|
16 |
+
{'label': 'optimism', 'score': 0.6123248934745789}]
|
17 |
+
```
|