Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def question_answering(question):
|
|
35 |
print(question)
|
36 |
query_sentence = [question]
|
37 |
query_embedding = st.session_state.model_embedding.encode(query_sentence)
|
38 |
-
k =
|
39 |
D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
|
40 |
answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 512) for i in range(k)]
|
41 |
best_answer = max(answer, key=lambda x: x['score'])
|
|
|
35 |
print(question)
|
36 |
query_sentence = [question]
|
37 |
query_embedding = st.session_state.model_embedding.encode(query_sentence)
|
38 |
+
k = 10000
|
39 |
D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
|
40 |
answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 512) for i in range(k)]
|
41 |
best_answer = max(answer, key=lambda x: x['score'])
|