-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow reranking nodes retrieved from vector DB
- Loading branch information
1 parent
45f79e3
commit 9a66e87
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Reranker for post-processing the Vector DB search results.""" | ||
|
||
import logging | ||
|
||
from llama_index.core.schema import NodeWithScore | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def rerank(retrieved_nodes: list[NodeWithScore]): | ||
"""Rerank Vector DB search results.""" | ||
message = "reranker.rerank() is called with %d result(s)." % len(retrieved_nodes) | ||
logger.debug(message) | ||
return retrieved_nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters