Hamda commited on
Commit
4bb560b
1 Parent(s): 68312e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
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
- 'Word':[],
17
- 'Score':[],
18
- }
19
-
20
-
21
-
22
  for e in pipe(text):
23
- if not any(e['token_str'] in string.punctuation):
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