NursNurs commited on
Commit
bfe5bb1
·
1 Parent(s): cb64b2f

Fixed a bug with the output function return_top_k

Browse files
Files changed (1) hide show
  1. pages/2_Context-based_chatbot.py +1 -1
pages/2_Context-based_chatbot.py CHANGED
@@ -42,7 +42,7 @@ def return_top_k(sentence, word=None, rels=False):
42
  # inputs = [f"Description : {sentence} Word : "]
43
 
44
  output = model(sentence)
45
- output = [output[i]['token_str'] for i in output.keys()]
46
  return output
47
 
48
 
 
42
  # inputs = [f"Description : {sentence} Word : "]
43
 
44
  output = model(sentence)
45
+ output = [output[i]['token_str'].strip() for i in range(len(output))]
46
  return output
47
 
48