Spaces:
Sleeping
Sleeping
Commit ·
8c9f197
1
Parent(s): 6c977f5
removed section text + improved to 25 top k
Browse files- index_retriever.py +2 -2
- utils.py +1 -1
index_retriever.py
CHANGED
|
@@ -16,12 +16,12 @@ def create_query_engine(vector_index):
|
|
| 16 |
try:
|
| 17 |
bm25_retriever = BM25Retriever.from_defaults(
|
| 18 |
docstore=vector_index.docstore,
|
| 19 |
-
similarity_top_k=
|
| 20 |
)
|
| 21 |
|
| 22 |
vector_retriever = VectorIndexRetriever(
|
| 23 |
index=vector_index,
|
| 24 |
-
similarity_top_k=
|
| 25 |
similarity_cutoff=0.5
|
| 26 |
)
|
| 27 |
|
|
|
|
| 16 |
try:
|
| 17 |
bm25_retriever = BM25Retriever.from_defaults(
|
| 18 |
docstore=vector_index.docstore,
|
| 19 |
+
similarity_top_k=25
|
| 20 |
)
|
| 21 |
|
| 22 |
vector_retriever = VectorIndexRetriever(
|
| 23 |
index=vector_index,
|
| 24 |
+
similarity_top_k=30,
|
| 25 |
similarity_cutoff=0.5
|
| 26 |
)
|
| 27 |
|
utils.py
CHANGED
|
@@ -103,7 +103,7 @@ def generate_sources_html(nodes, chunks_df=None):
|
|
| 103 |
metadata = node.metadata if hasattr(node, 'metadata') else {}
|
| 104 |
doc_type = metadata.get('type', 'text')
|
| 105 |
doc_id = metadata.get('document_id', 'unknown')
|
| 106 |
-
section_id = metadata.get('section_id', '')
|
| 107 |
|
| 108 |
html += f"<div style='margin-bottom: 15px; padding: 15px; border: 1px solid #4a5568; border-radius: 8px; background-color: #1a202c;'>"
|
| 109 |
|
|
|
|
| 103 |
metadata = node.metadata if hasattr(node, 'metadata') else {}
|
| 104 |
doc_type = metadata.get('type', 'text')
|
| 105 |
doc_id = metadata.get('document_id', 'unknown')
|
| 106 |
+
section_id = metadata.get('section_id', '')
|
| 107 |
|
| 108 |
html += f"<div style='margin-bottom: 15px; padding: 15px; border: 1px solid #4a5568; border-radius: 8px; background-color: #1a202c;'>"
|
| 109 |
|