Malek-AI/Bert
0
1import gradio as gr2from transformers import pipeline3 4def mask(text):5 mask_model = pipeline("fill-mask", model="google-bert/bert-base-uncased")6 output = mask_model(text)7 return output[0]['sequence']8 9 10# Gradio UI11examples=[['Today I went to [MASK] after I got out of bed.']]12ui = gr.Interface(13 fn=mask,14 inputs="textbox",15 outputs="textbox",16 submit_btn="Predict",17 title="BERT Test - Zircon.tech",18 description="Enter some text with [MASK] to let BERT guess the missing word!",19 examples=examples20 )21ui.launch(debug=True)22 