Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,9 +13,6 @@ def fill_mask(sentences):
|
|
13 |
st.warning(f"Warning: No <mask> token found in sentence: {sentence}")
|
14 |
return results
|
15 |
|
16 |
-
def clear_text_area():
|
17 |
-
st.session_state.text_area = ""
|
18 |
-
|
19 |
def replace_mask(sentence, predicted_word):
|
20 |
return sentence.replace("<mask>", f"**{predicted_word}**")
|
21 |
|
@@ -28,9 +25,6 @@ with col1:
|
|
28 |
with st.container(border=True):
|
29 |
sample_sentence = "Vhana vhane vha kha ḓi bva u bebwa vha kha khombo ya u <mask> nga Listeriosis."
|
30 |
|
31 |
-
if "text_input" not in st.session_state:
|
32 |
-
st.session_state.text_area = ""
|
33 |
-
|
34 |
text_input = st.text_area(
|
35 |
"Enter sentences with <mask> token:",
|
36 |
value=st.session_state.text_area
|
@@ -40,9 +34,6 @@ with col1:
|
|
40 |
|
41 |
if st.button("Submit"):
|
42 |
result = fill_mask(input_sentences)
|
43 |
-
|
44 |
-
if st.button("Clear"):
|
45 |
-
text_input = clear_text_area()
|
46 |
|
47 |
st.markdown("Example")
|
48 |
st.code(sample_sentence, wrap_lines=True)
|
|
|
13 |
st.warning(f"Warning: No <mask> token found in sentence: {sentence}")
|
14 |
return results
|
15 |
|
|
|
|
|
|
|
16 |
def replace_mask(sentence, predicted_word):
|
17 |
return sentence.replace("<mask>", f"**{predicted_word}**")
|
18 |
|
|
|
25 |
with st.container(border=True):
|
26 |
sample_sentence = "Vhana vhane vha kha ḓi bva u bebwa vha kha khombo ya u <mask> nga Listeriosis."
|
27 |
|
|
|
|
|
|
|
28 |
text_input = st.text_area(
|
29 |
"Enter sentences with <mask> token:",
|
30 |
value=st.session_state.text_area
|
|
|
34 |
|
35 |
if st.button("Submit"):
|
36 |
result = fill_mask(input_sentences)
|
|
|
|
|
|
|
37 |
|
38 |
st.markdown("Example")
|
39 |
st.code(sample_sentence, wrap_lines=True)
|