Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def question_answering(question):
|
|
28 |
print(question)
|
29 |
query_sentence = [question]
|
30 |
query_embedding = st.session_state.model_embedding.encode(query_sentence)
|
31 |
-
k =
|
32 |
D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
|
33 |
answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 256) for i in range(k)]
|
34 |
best_answer = max(answer, key=lambda x: x['score'])
|
|
|
28 |
print(question)
|
29 |
query_sentence = [question]
|
30 |
query_embedding = st.session_state.model_embedding.encode(query_sentence)
|
31 |
+
k = 10
|
32 |
D, I = index_loaded.search(query_embedding.astype('float32'), k) # D is distances, I is indices
|
33 |
answer = [question_answerer(question=query_sentence[0], context=articles[I[0][i]], max_answer_len = 256) for i in range(k)]
|
34 |
best_answer = max(answer, key=lambda x: x['score'])
|