Update app.py
Browse files
app.py
CHANGED
@@ -13,14 +13,11 @@ model = AutoModelForMaskedLM.from_pretrained("Hamda/test-1-finetuned-AraBART")
|
|
13 |
#@st.cache
|
14 |
def next_word(text, pipe):
|
15 |
res_dict= {
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
for e in pipe(text):
|
23 |
-
if not
|
24 |
res_dict['Word'].append(e['token_str'])
|
25 |
res_dict['Score'].append(e['score'])
|
26 |
return res_dict
|
|
|
13 |
#@st.cache
|
14 |
def next_word(text, pipe):
|
15 |
res_dict= {
|
16 |
+
'Word':[],
|
17 |
+
'Score':[],
|
18 |
+
}
|
|
|
|
|
|
|
19 |
for e in pipe(text):
|
20 |
+
if all(c not in list(string.punctuation) for c in e['token_str']):
|
21 |
res_dict['Word'].append(e['token_str'])
|
22 |
res_dict['Score'].append(e['score'])
|
23 |
return res_dict
|