Description
We should add a custom search_postprocess hook to allow reranking of retrieved results using a Hugging Face cross-encoder.
While the standard bi-encoder VectorStore.search() is fast, we can get much higher accuracy by passing the top retrieved results through a cross-encoder model that scores the query and document together.
Specifically, we want to try out huggingface models such as BAAI/bge-reranker-v2-m3. It has excellent benchmark performance and has very low compute requirements.
Description
We should add a custom
search_postprocesshook to allow reranking of retrieved results using a Hugging Face cross-encoder.While the standard bi-encoder
VectorStore.search()is fast, we can get much higher accuracy by passing the top retrieved results through a cross-encoder model that scores the query and document together.Specifically, we want to try out huggingface models such as
BAAI/bge-reranker-v2-m3. It has excellent benchmark performance and has very low compute requirements.