Reranking With a Cross-Encoder: Does It Help? Python Test
My search found the right page but did not put it first. Can a reranker fix that?
Video #42 ยท RAG and vector search
Steps in the video
Files
- compare.py (15 lines)
- docs.py (38 lines)
- search.py (31 lines)
Tested with
Python 3.12.15 | fastembed==0.9.1
What this does not show
Twelve made-up pages and twenty questions that I wrote, one small reranker, one small embedding model, one run on a laptop. A reranker can only reorder what the first stage found. A larger collection may give different numbers.
Sources
Learning IT by Example.