File size: 575 Bytes
18e9487
 
5c46664
18e9487
5c46664
 
18e9487
5c46664
3b79182
 
 
0b70cc6
ab91d69
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)