NLP_Tasks / app.py
DhimanBose's picture
Update app.py
0b7d64d verified
raw
history blame contribute delete
439 Bytes
pipe = pipeline("fill-mask", model="DhimanBose/FineTuned_BanglaBERT_for_Masked_Language_Model")
def image_classifier(inp):
dat=pipe(inp)
suggested_word=[]
for x in dat:
suggested_word.append(x['token_str']+" "+str(x['score']))
return 'Word'+" "+'Perchantage\n'+'\n '.join(suggested_word)
demo = gr.Interface(fn=image_classifier,inputs="text", outputs="text")
demo.launch()