M2S3 / app.py
Mohammed J
Create app.py
e285f21 verified
raw
history blame contribute delete
409 Bytes
from transformers import pipeline
import gradio as gr
sentiment = pipeline("sentiment-analysis")
def get_sentiment(text):
sent = sentiment(text)[0]['label']
score = sentiment(text)[0]['score']
return sent, score
interface = gr.Interface(fn = get_sentiment, inputs=gr.Textbox(label="Enter the review"), outputs = [gr.Textbox(label = "Sentiment :"), gr.Textbox(label = "Score :")])
interface.launch()