import gradio as gr from transformers import pipeline classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli") def do_action(text): candidate_labels = ['gun control', 'abortion', 'gender transition', 'freedom of speech', 'immigration', 'taxes'] result = classifier(text, candidate_labels) return result iface = gr.Interface(fn=do_action, inputs="text", outputs="text") iface.launch()