prashant
commited on
Commit
•
8e83ccf
1
Parent(s):
a4bf4e8
semantic update
Browse files- utils/search.py +4 -3
utils/search.py
CHANGED
@@ -289,9 +289,10 @@ def semantic_search(query:Text,documents:List[Document],show_answers = False):
|
|
289 |
st.markdown("---")
|
290 |
|
291 |
else:
|
292 |
-
|
293 |
-
doc = []
|
294 |
for answer in results['answers']:
|
|
|
|
|
295 |
if answer.score >0.01:
|
296 |
temp = answer.to_dict()
|
297 |
start_idx = temp['offsets_in_document'][0]['start']
|
@@ -299,7 +300,7 @@ def semantic_search(query:Text,documents:List[Document],show_answers = False):
|
|
299 |
|
300 |
matches.append([start_idx,end_idx])
|
301 |
doc.append(doc_store.get_document_by_id(temp['document_id']).content)
|
302 |
-
|
303 |
|
304 |
|
305 |
|
|
|
289 |
st.markdown("---")
|
290 |
|
291 |
else:
|
292 |
+
|
|
|
293 |
for answer in results['answers']:
|
294 |
+
matches = []
|
295 |
+
doc = []
|
296 |
if answer.score >0.01:
|
297 |
temp = answer.to_dict()
|
298 |
start_idx = temp['offsets_in_document'][0]['start']
|
|
|
300 |
|
301 |
matches.append([start_idx,end_idx])
|
302 |
doc.append(doc_store.get_document_by_id(temp['document_id']).content)
|
303 |
+
searchAnnotator(matches,doc)
|
304 |
|
305 |
|
306 |
|