gradio / app.py
reddym10's picture
Create app.py
89c4aad verified
raw
history blame
442 Bytes
import gradio as gr
from transformers import pipeline
def classify(text):
classifier = pipeline("zero-shot-classification")
candidate_labels = ["positive", "negative", "neutral"]
output = classifier(text, candidate_labels)
return output
demo = gr.Interface(fn=classify,
inputs=gr.Textbox(label="Enter something"),
outputs=gr.Label(num_top_classes=3))
demo.launch()