UnarineLeo commited on
Commit
aea2baa
1 Parent(s): e976ec9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -27,7 +27,10 @@ def replace_mask(sentence, predicted_word):
27
  st.title("Fill Mask for Multiple Languages | Zabantu-Bantu-250m")
28
  st.write("This app predicts the missing word for sentences in Zulu, Tshivenda, Sepedi, Tswana, and Tsonga using a Zabantu BERT model.")
29
 
30
- user_sentence = st.text_input("Enter your own sentence with a masked word (use '____'):", "\n".join(sample_sentences.values()))
 
 
 
31
 
32
  if st.button("Submit"):
33
  user_masked_sentence = user_sentence.replace('____', unmasker.tokenizer.mask_token)
 
27
  st.title("Fill Mask for Multiple Languages | Zabantu-Bantu-250m")
28
  st.write("This app predicts the missing word for sentences in Zulu, Tshivenda, Sepedi, Tswana, and Tsonga using a Zabantu BERT model.")
29
 
30
+ user_sentence = st.text_input("Enter your own sentence with a masked word (use '____'):", "\n".join(
31
+ f"'{lang}': '{sentence}',"
32
+ for lang, sentence in sample_sentences.items()
33
+ )
34
 
35
  if st.button("Submit"):
36
  user_masked_sentence = user_sentence.replace('____', unmasker.tokenizer.mask_token)