From faec3dc06b7b5be7604257e7711636ddc8f56627 Mon Sep 17 00:00:00 2001 From: Joan Martinez Date: Thu, 29 Feb 2024 16:49:37 +0100 Subject: [PATCH 1/2] docs: add reference to jina rerank module --- .../examples/node_postprocessor/JinaRerank.ipynb | 2 +- .../node_postprocessors/node_postprocessors.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/examples/node_postprocessor/JinaRerank.ipynb b/docs/examples/node_postprocessor/JinaRerank.ipynb index 5925382fc8e08..ce07b72652609 100644 --- a/docs/examples/node_postprocessor/JinaRerank.ipynb +++ b/docs/examples/node_postprocessor/JinaRerank.ipynb @@ -5,7 +5,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "\"Open" + "\"Open" ] }, { diff --git a/docs/module_guides/querying/node_postprocessors/node_postprocessors.md b/docs/module_guides/querying/node_postprocessors/node_postprocessors.md index 86d78d23799f4..03e6cff91f213 100644 --- a/docs/module_guides/querying/node_postprocessors/node_postprocessors.md +++ b/docs/module_guides/querying/node_postprocessors/node_postprocessors.md @@ -127,6 +127,22 @@ postprocessor.postprocess_nodes(nodes) Full notebook guide is available [her for Gatsby](/examples/node_postprocessor/LLMReranker-Gatsby.ipynb) and [here for Lyft 10K documents](/examples/node_postprocessor/LLMReranker-Lyft-10k.ipynb). +## JinaRerank + +Uses the "Cohere ReRank" functionality to re-order nodes, and returns the top N nodes. + +```python +from llama_index.postprocessor.jinaai_rerank import JinaRerank + +postprocessor = JinaRerank( + top_n=2, model="jina-reranker-v1-base-en", api_key="YOUR JINA API KEY" +) + +postprocessor.postprocess_nodes(nodes) +``` + +Full notebook guide is available [here](/examples/node_postprocessor/JinaRerank.ipynb). + ## FixedRecencyPostprocessor This postproccesor returns the top K nodes sorted by date. This assumes there is a `date` field to parse in the metadata of each node. From a3defa6c70fd2c2dd76f76dccddbfe7399b62012 Mon Sep 17 00:00:00 2001 From: Joan Martinez Date: Thu, 29 Feb 2024 17:02:05 +0100 Subject: [PATCH 2/2] fix: jina rerank fix --- .../querying/node_postprocessors/node_postprocessors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/module_guides/querying/node_postprocessors/node_postprocessors.md b/docs/module_guides/querying/node_postprocessors/node_postprocessors.md index 03e6cff91f213..c1dcd3118289d 100644 --- a/docs/module_guides/querying/node_postprocessors/node_postprocessors.md +++ b/docs/module_guides/querying/node_postprocessors/node_postprocessors.md @@ -129,7 +129,7 @@ Full notebook guide is available [her for Gatsby](/examples/node_postprocessor/L ## JinaRerank -Uses the "Cohere ReRank" functionality to re-order nodes, and returns the top N nodes. +Uses the "Jina ReRank" functionality to re-order nodes, and returns the top N nodes. ```python from llama_index.postprocessor.jinaai_rerank import JinaRerank