Update app.py
Browse files
app.py
CHANGED
@@ -9,11 +9,11 @@ st.set_page_config(layout="wide")
|
|
9 |
def fill_mask(sentences):
|
10 |
results = {}
|
11 |
warnings = []
|
12 |
-
for
|
13 |
if "<mask>" in sentence:
|
14 |
masked_sentence = sentence.replace('<mask>', unmasker.tokenizer.mask_token)
|
15 |
unmasked = unmasker(masked_sentence)
|
16 |
-
results[
|
17 |
else:
|
18 |
warnings.append(f"Warning: No <mask> token found in sentence: {sentence}")
|
19 |
return results, warnings
|
|
|
9 |
def fill_mask(sentences):
|
10 |
results = {}
|
11 |
warnings = []
|
12 |
+
for language, sentence in sentences.items():
|
13 |
if "<mask>" in sentence:
|
14 |
masked_sentence = sentence.replace('<mask>', unmasker.tokenizer.mask_token)
|
15 |
unmasked = unmasker(masked_sentence)
|
16 |
+
results[language] = unmasked
|
17 |
else:
|
18 |
warnings.append(f"Warning: No <mask> token found in sentence: {sentence}")
|
19 |
return results, warnings
|