Arman511's picture
Update app.py
bd77e63
raw
history blame contribute delete
345 Bytes
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()