File size: 345 Bytes
4e428b3
 
 
d5a33ba
4e428b3
eaafae6
4e428b3
 
 
bd77e63
4e428b3
 
bd77e63
eaafae6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from fastai.text.all import *
import gradio as gr

learn = load_learner('export.pkl')

categories = ('Negative', 'Positive')
label = gr.outputs.Label()
def classify(text):
    pred,pred_idx,probs = learn.predict(text)
    return dict(zip(categories, map(float,probs)))


intf = gr.Interface(fn=classify,inputs="text",outputs=label)
intf.launch()