MyApp / app.py
cherryredddd's picture
Create app.py
01e807c verified
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 UI
iface = gr.Interface(
fn = get_sentiment,
inputs = "text",
outputs = "text",
title = "My AI App",
description = "This is my first AI App !!!. Enter Some text and i will tell you the sentiment."
)
iface.launch()