antypasd's picture
Create README.md
2a9e2b0
|
raw
history blame
832 Bytes

cardiffnlp/twitter-roberta-base-latest-tweet-emoji

This is a RoBERTa-base model fine-tuned on tweet-emoji.

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}]