Quickstart
To use a reranker, you perform a search and then pass the results to thererank() method.
Supported Rerankers
LanceDB supports several rerankers out of the box. Here are a few examples:| Reranker | Default Model |
|---|---|
CohereReranker | rerank-english-v2.0 |
CrossEncoderReranker | cross-encoder/ms-marco-MiniLM-L-6-v2 |
ColbertReranker | colbert-ir/colbertv2.0 |
Multi-vector reranking
Most rerankers support reranking based on multiple vectors. To rerank based on multiple vectors, you can pass a list of vectors to thererank method. Here’s an example of how to rerank based on multiple vector columns using the CrossEncoderReranker:
Creating Custom Rerankers
LanceDB also you to create custom rerankers by extending the baseReranker class. The custom reranker
should implement the rerank method that takes a list of search results and returns a reranked list of
search results. This is covered in more detail in the creating custom rerankers section.