Spaces:
Runtime error
Runtime error
dorogan
commited on
Commit
•
069179d
1
Parent(s):
0dc1fdf
Fixes: all document text was added to the semantic search result
Browse files- semantic_search.py +2 -1
semantic_search.py
CHANGED
@@ -202,10 +202,11 @@ class SemanticSearch:
|
|
202 |
docs = []
|
203 |
for ref in preds:
|
204 |
doc_index = self.docs_names.index(ref)
|
|
|
205 |
most_relevant_teaser = self.get_most_relevant_teaser(question=query,
|
206 |
doc_index=doc_index)
|
207 |
if use_llm_for_teasers:
|
208 |
most_relevant_teaser = self.rebuild_teaser_with_llm(question=query,
|
209 |
teaser=most_relevant_teaser)
|
210 |
-
docs.append(most_relevant_teaser)
|
211 |
return preds[:top], docs[:top], scores[:top]
|
|
|
202 |
docs = []
|
203 |
for ref in preds:
|
204 |
doc_index = self.docs_names.index(ref)
|
205 |
+
doc_text = self.all_docs_info[doc_index]['doc_text']
|
206 |
most_relevant_teaser = self.get_most_relevant_teaser(question=query,
|
207 |
doc_index=doc_index)
|
208 |
if use_llm_for_teasers:
|
209 |
most_relevant_teaser = self.rebuild_teaser_with_llm(question=query,
|
210 |
teaser=most_relevant_teaser)
|
211 |
+
docs.append(most_relevant_teaser + '\n' + f'Весь текст документа:\n{doc_text}')
|
212 |
return preds[:top], docs[:top], scores[:top]
|