myfirstapp / app.py
krishnaps's picture
Update app.py
a1c7bf0 verified
raw
history blame contribute delete
412 Bytes
import gradio as gr
from transformers import pipeline
sentiment_pipeline = pipeline("sentiment-analysis")
def get_sentiment(input_text):
result = sentiment_pipeline(input_text)
return result[0]['label']
# Launch web UI
iface = gr.Interface(
fn=get_sentiment,
inputs='text',
outputs='text', # 'output' should be 'outputs'
title='my first AI app',
description=""
)
iface.launch()