Arman511 commited on
Commit
4e428b3
·
1 Parent(s): 2a0be60

Create new file

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.text.all import *
2
+ import gradio as gr
3
+
4
+ learn.load_learner('export.pkl')
5
+
6
+ categories = ('Negative', 'Positive')
7
+ label = gr.outputs.Label()
8
+ def classify(text):
9
+ pred,pred_idx,probs = learn.predict(text)
10
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
11
+
12
+
13
+ intf = gr.Interface(fn=classify,inputs="text", outputs=label).launch(share=True)