|
import gradio as gr |
|
|
|
from transformers import pipeline |
|
|
|
classifier3 = pipeline('text-classification', model='nlmaldonadog/clasificador-rotten-tomatoes-bert-base-uncased') |
|
classifier4 = pipeline('text-classification', model='nlmaldonadog/clasificador-rotten-tomatoes-xlnet-base-cased') |
|
|
|
def predict(text): |
|
prediction3 = "Model 3 " + str(classifier3(text)) |
|
prediction4 = "\nModel 4 " + str(classifier4(text)) |
|
return prediction3 + prediction4 |
|
|
|
ifg = gr.Interface(fn=predict, inputs=[gr.Textbox(placeholder='Escribe aquí...')], outputs="text") |
|
ifg.launch(share=True) |