Spaces:
Sleeping
Sleeping
| from transformers import pipeline | |
| import gradio as gr | |
| classifier = pipeline("zero-shot-classification") | |
| def classify(text, labels): | |
| labels_list = labels.split(",") | |
| result = classifier(text, candidate_labels=labels_list) | |
| return result | |
| demo = gr.Interface( | |
| fn=classify, | |
| inputs=[ | |
| gr.Textbox(label="Enter Text"), | |
| gr.Textbox(label="Labels (comma separated)") | |
| ], | |
| outputs="json", | |
| title="Zero-Shot Classification App" | |
| ) | |
| demo.launch() |