Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def question_answering(question):
|
|
43 |
print(question)
|
44 |
query_sentence = [question]
|
45 |
query_embedding = st.session_state.model_embedding.encode(query_sentence)
|
46 |
-
k =
|
47 |
D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
|
48 |
answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 512) for i in range(k)]
|
49 |
best_answer = max(answer, key=lambda x: x['score'])
|
|
|
43 |
print(question)
|
44 |
query_sentence = [question]
|
45 |
query_embedding = st.session_state.model_embedding.encode(query_sentence)
|
46 |
+
k = 200
|
47 |
D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
|
48 |
answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 512) for i in range(k)]
|
49 |
best_answer = max(answer, key=lambda x: x['score'])
|