Linhz commited on
Commit
0df994c
·
verified ·
1 Parent(s): 05712e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -37,7 +37,7 @@ def question_answering(question):
37
  print(question)
38
  query_sentence = [question]
39
  query_embedding = st.session_state.model_embedding.encode(query_sentence)
40
- k = 20
41
  D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
42
  answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 256) for i in range(k)]
43
  best_answer = max(answer, key=lambda x: x['score'])
 
37
  print(question)
38
  query_sentence = [question]
39
  query_embedding = st.session_state.model_embedding.encode(query_sentence)
40
+ k = 100
41
  D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
42
  answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 256) for i in range(k)]
43
  best_answer = max(answer, key=lambda x: x['score'])