antypasd's picture
Update README.md
8b38f1d
|
raw
history blame
826 Bytes

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

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

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