Space7_basic / app.py
pm's picture
Update app.py
f611a06 verified
raw
history blame
No virus
430 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()