File size: 382 Bytes
e8e7408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from transformers import pipeline
text_classifier = pipeline('sentiment-analysis')
def predict(text):
    result = text_classifier(text)
    return result[0]['label']
iface = gr.Interface(
    fn=predict,
    inputs=gr.Textbox(),
    outputs=gr.Textbox()
)
iface = gr.Interface(
    fn=predict,
    inputs=gr.Textbox(),
    outputs=gr.Textbox()
)
iface.launch()