DhimanBose commited on
Commit
913c4e5
·
verified ·
1 Parent(s): 842a8bc

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+ pipe = pipeline("fill-mask", model="sagorsarker/bangla-bert-base")
4
+
5
+
6
+ def image_classifier(inp):
7
+
8
+ dat=pipe(inp)
9
+ suggested_word=[]
10
+ for x in dat:
11
+ suggested_word.append(x['token_str']+" "+str(x['score']))
12
+ return 'Word'+" "+'Perchantage\n'+'\n '.join(suggested_word)
13
+
14
+
15
+ demo = gr.Interface(fn=image_classifier,inputs="text", outputs="text")
16
+ demo.launch()