Views
No views yet
"id2label": {
"0": "anger",
"1": "anticipation",
"2": "disgust",
"3": "fear",
"4": "joy",
"5": "love",
"6": "optimism",
"7": "pessimism",
"8": "sadness",
"9": "surprise",
"10": "trust"
}
1from transformers import pipeline
2text= "@user it also helps that the majority of NFL coaching is inept. Some of Bill O'Brien's play calling was wow, ! #GOPATS"
3
4pipe = pipeline('text-classification', model="cardiffnlp/twitter-roberta-large-emotion-latest", return_all_scores=True)
5predictions = pipe(text)[0]
6predictions = [x for x in predictions if x['score'] > 0.5]
7predictions
8>> [{'label': 'anger', 'score': 0.927680253982544},
9 {'label': 'disgust', 'score': 0.895420491695404},
10 {'label': 'joy', 'score': 0.9239692687988281},
11 {'label': 'optimism', 'score': 0.6795405745506287}]1@inproceedings{antypas2023supertweeteval,
2 title={SuperTweetEval: A Challenging, Unified and Heterogeneous Benchmark for Social Media NLP Research},
3 author={Dimosthenis Antypas and Asahi Ushio and Francesco Barbieri and Leonardo Neves and Kiamehr Rezaee and Luis Espinosa-Anke and Jiaxin Pei and Jose Camacho-Collados},
4 booktitle={Findings of the Association for Computational Linguistics: EMNLP 2023},
5 year={2023}
6}