Reranker
Using Model Library to Rerank the Search Results
Boost your search results with PyMilvus's Reranker models (2.4.0+), designed to refine and prioritize your search outcomes for optimal relevance. This guide will introduce you to the integration of advanced reranker models, enhancing your search system's accuracy. Starting with a quick setup of necessary dependencies (optionally within a virtual environment), we'll cover the essentials of utilizing these models to elevate your search functionalities to new heights.
BGE Rerank Function
This rerank function uses FlagEmbedding's reranker to reorder documents according to query. For more information, please visit their repository.
3 [RerankResult(text="The Dartmouth Conference in 1956 is considered the birthplace of artificial intelligence as a field; here, John McCarthy and others coined the term 'artificial intelligence' and laid out its basic goals.", score=0.9911526449170697, index=1), RerankResult(text="In 1950, Alan Turing published his seminal paper, 'Computing Machinery and Intelligence,' proposing the Turing Test as a criterion of intelligence, a foundational concept in the philosophy and development of artificial intelligence.", score=0.03252822350114495, index=0), RerankResult(text='The invention of the Logic Theorist by Allen Newell, Herbert A. Simon, and Cliff Shaw in 1955 marked the creation of the first true AI program, which was capable of solving logic problems, akin to proving mathematical theorems.', score=0.006538824977235004, index=3)]
Voyage Rerank Function
This rerank function uses Voyage AI's reranker to reorder documents according to query. For more information, please visit their documentation.
3 [RerankResult(text="The Dartmouth Conference in 1956 is considered the birthplace of artificial intelligence as a field; here, John McCarthy and others coined the term 'artificial intelligence' and laid out its basic goals.", score=0.8984375, index=1), RerankResult(text='The invention of the Logic Theorist by Allen Newell, Herbert A. Simon, and Cliff Shaw in 1955 marked the creation of the first true AI program, which was capable of solving logic problems, akin to proving mathematical theorems.', score=0.71875, index=3), RerankResult(text="In 1950, Alan Turing published his seminal paper, 'Computing Machinery and Intelligence,' proposing the Turing Test as a criterion of intelligence, a foundational concept in the philosophy and development of artificial intelligence.", score=0.6640625, index=0)]
Cohere Rerank Function
This rerank function uses Cohere's reranker to reorder documents according to query. For more information, please visit their documentation.
3 [RerankResult(text="The Dartmouth Conference in 1956 is considered the birthplace of artificial intelligence as a field; here, John McCarthy and others coined the term 'artificial intelligence' and laid out its basic goals.", score=0.99691266, index=1), RerankResult(text='The invention of the Logic Theorist by Allen Newell, Herbert A. Simon, and Cliff Shaw in 1955 marked the creation of the first true AI program, which was capable of solving logic problems, akin to proving mathematical theorems.', score=0.8578872, index=3), RerankResult(text="In 1950, Alan Turing published his seminal paper, 'Computing Machinery and Intelligence,' proposing the Turing Test as a criterion of intelligence, a foundational concept in the philosophy and development of artificial intelligence.", score=0.3589146, index=0)]
Cross-Encoder Rerank Function
This rerank function uses Sentence-Transformers's Cross-Encoders to reorder documents according to query. For more information, please visit their documentation.
3 [RerankResult(text="The Dartmouth Conference in 1956 is considered the birthplace of artificial intelligence as a field; here, John McCarthy and others coined the term 'artificial intelligence' and laid out its basic goals.", score=6.250533580780029, index=1), RerankResult(text="In 1950, Alan Turing published his seminal paper, 'Computing Machinery and Intelligence,' proposing the Turing Test as a criterion of intelligence, a foundational concept in the philosophy and development of artificial intelligence.", score=-2.954602003097534, index=0), RerankResult(text='The invention of the Logic Theorist by Allen Newell, Herbert A. Simon, and Cliff Shaw in 1955 marked the creation of the first true AI program, which was capable of solving logic problems, akin to proving mathematical theorems.', score=-4.771515846252441, index=3)]