Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,13 +9,19 @@ def main():
|
|
| 9 |
st.markdown('Mask a word with [MASK]. For example, **I [MASK] dog for a walk**')
|
| 10 |
masked = st.text_input('Masked sentence','Please insert a sentence')
|
| 11 |
|
| 12 |
-
|
| 13 |
-
mask_check = re.search(masked, mask_str)
|
| 14 |
|
| 15 |
-
if
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
if __name__ == "__main__":
|
| 21 |
main()
|
|
|
|
| 9 |
st.markdown('Mask a word with [MASK]. For example, **I [MASK] dog for a walk**')
|
| 10 |
masked = st.text_input('Masked sentence','Please insert a sentence')
|
| 11 |
|
| 12 |
+
submitted = st.form_submit_button("Submit")
|
|
|
|
| 13 |
|
| 14 |
+
if submitted:
|
| 15 |
+
mask_str = '[MASK]'
|
| 16 |
+
mask_check = re.search(masked, mask_str)
|
| 17 |
+
|
| 18 |
+
if mask_check:
|
| 19 |
+
st.success("Submitted")
|
| 20 |
+
output = unmasker(masked)
|
| 21 |
+
|
| 22 |
+
st.write('Filled sentence:',output[0]['sequence'])
|
| 23 |
+
else:
|
| 24 |
+
st.write('Sentence is not masked!!!')
|
| 25 |
|
| 26 |
if __name__ == "__main__":
|
| 27 |
main()
|