antoniorached's picture
Update app.py
65b16f5 verified
raw
history blame
413 Bytes
from transformers import pipeline
import gradio as gr
pipe = pipeline("sentiment-analysis")
def get_sentiment(input):
prediction = pipe(input)
return f'{prediction[0].label} {prediction[0].score * 100}'
demo = gr.Interface(
fn=get_sentiment,
inputs="text",
outputs="text",
title="Sentiment Analysis",
description="Get a sentimental analysis for the provided text"
)
demo.launch()