Practica7 / app.py
lauragordo's picture
Update app.py
e4b7ffb verified
raw
history blame contribute delete
748 Bytes
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()