NursNurs commited on
Commit
2a20515
·
1 Parent(s): 2c8ef78

fix on repetitions

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -75,7 +75,7 @@ def return_top_k(sentence, k=10):
75
  predictions = [tokenizer.decode(tokens, skip_special_tokens=True) for tokens in output_sequences['sequences']]
76
  probabilities = [round(float(prob), 2) for prob in decoded_probabilities]
77
 
78
- stripped_sent = [remove_punctuation(word) for word in sentence.split()]
79
  for pred in predictions:
80
  if (len(pred) < 2) | (pred in stripped_sent):
81
  predictions.pop(predictions.index(pred))
 
75
  predictions = [tokenizer.decode(tokens, skip_special_tokens=True) for tokens in output_sequences['sequences']]
76
  probabilities = [round(float(prob), 2) for prob in decoded_probabilities]
77
 
78
+ stripped_sent = [remove_punctuation(word.lower()) for word in sentence.split()]
79
  for pred in predictions:
80
  if (len(pred) < 2) | (pred in stripped_sent):
81
  predictions.pop(predictions.index(pred))