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