text-classification tensorflow

Usage


from transformers import RobertaTokenizerFast, TFRobertaForSequenceClassification, pipeline

tokenizer = RobertaTokenizerFast.from_pretrained("cappuch/Emotions_BERT")
model = TFRobertaForSequenceClassification.from_pretrained("cappuch/Emotions_BERT")

classific = pipeline('sentiment-analysis', 
                    model='cappuch/Emotions_BERT')

labels = classific("Hello!")
print(labels)

#[{'label': 'neutral', 'score': 0.9964383244514465}]