Spaces:
Sleeping
Sleeping
improve retrieved document parsing
Browse files
app.py
CHANGED
@@ -122,6 +122,7 @@ def retriever(query: str, selected_retriever: str):
|
|
122 |
# Add a blinking cursor to simulate typing
|
123 |
placeholder.markdown(text + "▌")
|
124 |
placeholder.markdown(text)
|
|
|
125 |
|
126 |
if retriever_endpoint == "None":
|
127 |
return ""
|
@@ -147,7 +148,7 @@ def retriever(query: str, selected_retriever: str):
|
|
147 |
retrieved_document_titles = ""
|
148 |
for document in topk_documents:
|
149 |
try:
|
150 |
-
idx = document.lower().index("abstract:
|
151 |
title = document[:idx].replace('\n', ' ')
|
152 |
retrieved_document_titles = retrieved_document_titles + title + '\n'
|
153 |
except:
|
|
|
122 |
# Add a blinking cursor to simulate typing
|
123 |
placeholder.markdown(text + "▌")
|
124 |
placeholder.markdown(text)
|
125 |
+
placeholder.markdown("\n")
|
126 |
|
127 |
if retriever_endpoint == "None":
|
128 |
return ""
|
|
|
148 |
retrieved_document_titles = ""
|
149 |
for document in topk_documents:
|
150 |
try:
|
151 |
+
idx = document.lower().index("abstract:")
|
152 |
title = document[:idx].replace('\n', ' ')
|
153 |
retrieved_document_titles = retrieved_document_titles + title + '\n'
|
154 |
except:
|