from transformers import pipeline | |
import gradio as grad | |
roberta_pipe = pipeline( | |
"sentiment-analysis", | |
model="siebert/sentiment-roberta-large-english", | |
tokenizer="siebert/sentiment-roberta-large-english", | |
return_all_scores = True | |
) | |
def analyse_sentiment(text): | |
response = roberta_pipe(text) | |
return response | |
grad.Interface(fn=analyse_sentiment, inputs="text", outputs="text").launch() |