MyApp / app.py
Meera22's picture
Update app.py
8905321 verified
raw
history blame contribute delete
455 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 the web
iface = gr.Interface(
fn = get_sentiment,
inputs = "text",
outputs = "text",
title = "My first AI App",
description = "Enter some text and I'll tell you whether it is positive or negative"
)
iface.launch()