Spaces:
Sleeping
Sleeping
Commit
·
c046733
1
Parent(s):
101cdda
fix: new embeddings and rerankh5
Browse files
app/services/reranker_service.py
CHANGED
|
@@ -110,9 +110,9 @@ def rerank_chunks(query: str, chunks: List[Dict], metadata_map: Dict) -> List[Di
|
|
| 110 |
# Sort the chunks by the new score in descending order
|
| 111 |
sorted_chunks = sorted(chunks, key=lambda x: x.get('rerank_score', 0.0), reverse=True)
|
| 112 |
|
| 113 |
-
logger.
|
| 114 |
-
for i, chunk in enumerate(sorted_chunks[:
|
| 115 |
-
logger.
|
| 116 |
-
logger.
|
| 117 |
|
| 118 |
return sorted_chunks
|
|
|
|
| 110 |
# Sort the chunks by the new score in descending order
|
| 111 |
sorted_chunks = sorted(chunks, key=lambda x: x.get('rerank_score', 0.0), reverse=True)
|
| 112 |
|
| 113 |
+
logger.info("--- Top 5 Custom Re-ranked Chunks (v4) ---")
|
| 114 |
+
for i, chunk in enumerate(sorted_chunks[:100]):
|
| 115 |
+
logger.info(f" {i+1}. Chunk ID: {chunk.get('id', 'N/A')} | New Score: {chunk.get('rerank_score', 0.0):.4f}")
|
| 116 |
+
logger.info("--------------------------------")
|
| 117 |
|
| 118 |
return sorted_chunks
|