first_space / app.py
jfo25's picture
Create app.py
bd837b6 verified
Raw
History Blame Contribute Delete
354 Bytes
import gradio as gr
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
def predict_sentiment(text):
return classifier(text)[0]
gr.Interface(fn=predict_sentiment,
inputs=gr.Textbox(label="Enter a sentence"),
outputs=gr.Label(label="Sentiment"),
title="Sentiment Classifier").launch()