from transformers import pipeline import gradio as gr classifier = pipeline('text-classification', model='lauragordo/clasificador-rotten-tomatoes') def text_classification(text): return classifier(text)[0]['label'] examples=["This is wonderful movie!", "The movie was really bad; I didn't like it."] io = gr.Interface(fn=text_classification, inputs= gr.Textbox(lines=2, label="Text", placeholder="Enter title here..."), outputs=gr.Textbox(lines=2, label="Text Classification Result"), title="Text Classification", description="Enter a text and see the text classification result!", examples=examples) io.launch()