diff --git a/docs/module_guides/querying/node_postprocessors/node_postprocessors.md b/docs/module_guides/querying/node_postprocessors/node_postprocessors.md index c1dcd3118289d3..189cfb15228c03 100644 --- a/docs/module_guides/querying/node_postprocessors/node_postprocessors.md +++ b/docs/module_guides/querying/node_postprocessors/node_postprocessors.md @@ -270,7 +270,48 @@ postprocessor = RankGPTRerank(top_n=3, llm=OpenAI(model="gpt-3.5-turbo-16k")) postprocessor.postprocess_nodes(nodes) ``` -Full notebook guide is available [her for Van Gogh](/examples/node_postprocessor/rankGPT.ipynb). +Full notebook guide is available [here](/examples/node_postprocessor/rankGPT.ipynb). + +## Colbert Reranker + +Uses Colbert V2 model as a reranker to rerank documents according to the fine-grained similarity between query tokens and passage tokens. Returns the top N ranked nodes. + +```python +from llama_index.postprocessor.colbert_rerank import ColbertRerank + +colbert_reranker = ColbertRerank( + top_n=5, + model="colbert-ir/colbertv2.0", + tokenizer="colbert-ir/colbertv2.0", + keep_retrieval_score=True, +) + +query_engine = index.as_query_engine( + similarity_top_k=10, + node_postprocessors=[colbert_reranker], +) +response = query_engine.query( + query_str, +) +``` + +Full notebook guide is available [here](/examples/node_postprocessor/ColbertRerank.ipynb). + +## Jina Reranker + +Uses models from [jina](https://jina.ai/) to rerank documents. Returns the top N ranked nodes. + +```python +from llama_index.postprocessor.jinaai_rerank import JinaRerank + +jina_rerank = JinaRerank(api_key=api_key, top_n=2) + +query_engine = index.as_query_engine( + similarity_top_k=10, node_postprocessors=[jina_rerank] +) +``` + +Full notebook guide is available [here](/examples/node_postprocessor/JinaRerank.ipynb). ## All Notebooks @@ -289,4 +330,6 @@ maxdepth: 1 /examples/node_postprocessor/MetadataReplacementDemo.ipynb /examples/node_postprocessor/LongContextReorder.ipynb /examples/node_postprocessor/rankGPT.ipynb +/examples/node_postprocessor/ColbertRerank.ipynb +/examples/node_postprocessor/JinaRerank.ipynb ```