Skip to content

Commit

Permalink
docs: add reference to jina rerank module (#11507)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanFM authored Feb 29, 2024
1 parent 4b765f4 commit d315271
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/examples/node_postprocessor/JinaRerank.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/node_postprocessor/CohereRerank.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/node_postprocessor/JinaRerank.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d315271

Please sign in to comment.