Update app.py
Browse files
app.py
CHANGED
|
@@ -7,19 +7,14 @@ def mask(text):
|
|
| 7 |
return output[0]['sequence']
|
| 8 |
|
| 9 |
# Gradio UI
|
| 10 |
-
|
| 11 |
-
# gr.Markdown("BERT Test - Zircon.tech")
|
| 12 |
-
# gr.Button("Predict").click(fn=mask,
|
| 13 |
-
# inputs = gr.Textbox(label="Give me a sentance and use the word [MASK] to predict what will go there"),
|
| 14 |
-
# outputs = gr.Textbox())
|
| 15 |
-
# ui.launch(share=True)
|
| 16 |
-
|
| 17 |
ui = gr.Interface(
|
| 18 |
fn=mask,
|
| 19 |
-
inputs="
|
| 20 |
-
outputs="
|
| 21 |
submit_btn="Predict",
|
| 22 |
-
title="BERT
|
| 23 |
-
description="
|
|
|
|
| 24 |
)
|
| 25 |
-
ui.launch(share=True)
|
|
|
|
| 7 |
return output[0]['sequence']
|
| 8 |
|
| 9 |
# Gradio UI
|
| 10 |
+
examples=[['Today I went to [MASK] after I got out of bed.']]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
ui = gr.Interface(
|
| 12 |
fn=mask,
|
| 13 |
+
inputs="text",
|
| 14 |
+
outputs="text",
|
| 15 |
submit_btn="Predict",
|
| 16 |
+
title="BERT-based Text Analyzer",
|
| 17 |
+
description="Enter some text to analyze with BERT!",
|
| 18 |
+
examples=examples
|
| 19 |
)
|
| 20 |
+
ui.launch(share=True)
|