Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ async def answer_question(request: AnswerQuestionRequest):
|
|
45 |
corpus_embeddings = model.encode(request.context, convert_to_tensor=True)
|
46 |
query_embeddings = model.encode(request.question, convert_to_tensor=True)
|
47 |
hits = util.semantic_search(query_embeddings, corpus_embeddings)
|
48 |
-
for hit in hits:
|
49 |
if hit['score'] > .5:
|
50 |
loc = hit['corpus_id']
|
51 |
res_locs.append(request.locations[loc])
|
|
|
45 |
corpus_embeddings = model.encode(request.context, convert_to_tensor=True)
|
46 |
query_embeddings = model.encode(request.question, convert_to_tensor=True)
|
47 |
hits = util.semantic_search(query_embeddings, corpus_embeddings)
|
48 |
+
for hit in hits[0]:
|
49 |
if hit['score'] > .5:
|
50 |
loc = hit['corpus_id']
|
51 |
res_locs.append(request.locations[loc])
|