Add Time-Weighted Rerank postprocessor to document insertion process #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for the Time-Weighted Rerank postprocessor during the document insertion process in the LlamaIndex repository. The Time-Weighted Rerank postprocessor allows for better ranking of documents based on their recency.
Changes Made
insert
andinsert_nodes
methods inllama_index/indices/base.py
to apply the Time-Weighted Rerank postprocessor during the document insertion process._add_nodes_to_index
and_async_add_nodes_to_index
methods inllama_index/indices/vector_store/base.py
to properly store the document's metadata (including its timestamp) in the index.How to Test
add-time-weighted-rerank-postprocessor
branch.insert
orinsert_nodes
methods.Related Issues
Resolves #[issue_number]
Checklist
Fixes #8.
To checkout this PR branch, run the following command in your terminal: