Spaces:
Runtime error
Runtime error
from transformers import pipeline | |
import gradio as gr | |
sentiment = pipeline("sentiment-analysis") | |
def sentiment_analysis(text): | |
results = sentiment(text) | |
return results[0]["label"], round(results[0]["score"], 5) | |
demo = gr.Interface( | |
fn = sentiment_analysis, | |
inputs=gr.Textbox(lines=2, placeholder="Here...", label= 'Enter Text to Classify here'), | |
outputs=[ | |
gr.Textbox(label = 'status'), | |
gr.Textbox(label = 'score') | |
] | |
) | |
demo.launch() | |