non2013 commited on
Commit
f5b14b4
·
1 Parent(s): 7c57e03

edit preprocess

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -39,8 +39,9 @@ def preprocess_text(text):
39
  for doc in docs:
40
  for token in doc:
41
  if token.pos_ != "PUNCT":
42
- index = word_dict.get(token.text, OOV_INDEX)
43
- word_seq.append(index)
 
44
  return word_seq
45
 
46
  def classify_question(text):
 
39
  for doc in docs:
40
  for token in doc:
41
  if token.pos_ != "PUNCT":
42
+ if token.text not in word_dict:
43
+ word_dict[token.text] = OOV_INDEX
44
+ word_seq.append(word_dict[token.text])
45
  return word_seq
46
 
47
  def classify_question(text):