🦹 Re-rank retrieved results
Re-rankers are specialized models that are trained to calculate the relevance between query-document pairs. Without re-ranking the order of retrieved results is governed by the embedding model, which isn't optimized for relevance and can lead to poor LLM recall in RAG applications.
In this workshop, we will use rerank-2.5, a state-of-the-art re-ranking model from Voyage AI.
Fill in any <CODE_BLOCK_N>
placeholders and run the cells under the 🦹♀️ Re-rank retrieved results section in the notebook to add a re-ranking stage to the chatbot.
The answers for code blocks in this section are as follows:
CODE_BLOCK_18
Answer
vo.rerank(user_query, documents, model="rerank-2.5", top_k=5)