Rerank Search Results
Initial search results often fail to capture nuanced relevance or diversity, potentially leading to suboptimal user experiences. Utilizing Vectara's reranking can significantly enhance the quality and usefulness of search results, leading to more effective information retrieval. Reranking search results involves a process of rescoring and refining an initial set of query results to achieve a more precise ranking. It employs a machine learning model that while slower than the rapid retrieval step, offers more accurate results.
We currently provides the following rerankers:
- Multilingual Reranker v1 (
type=customer_specific
andreranker_id=rnk_272725719
) for accurate results across over 100 languages. - Maximal Marginal Relevance (MMR) Reranker (
type=mmr
) for diversifying results while maintaining relevance. - User Defined Function Reranker (
type=userfn
) for custom scoring based on metadata. - Chain Reranker (
type=chain
) for combining multiple reranking strategies in sequence to meet more complex search requirements.
Enable reranking
To enable reranking, specify the appropriate value for the type
in the
reranker
object. For the MMR reranker, use mmr
. In most scenarios,
it makes sense to use the default query start
value of 0
so that you're
reranking all of the best initial results. You can also set limit
of the
query
to the total number of documents you wish to rerank. The default value
is 25
.
The following example shows the limit
and type
values in a query. Note that
this simplified example intentionally omits several parameter values.
{
"query": "What is my question?",
"stream_response": false,
"search": {
"start": 0,
"limit": 25,
"context_configuration": {},
},
"reranker": {
"type": "mmr",
"diversity_bias": "0.4"
},
"generation": [],
"enable_factual_consistency_score": true
}
You can also enable reranking in the Vectara console after navigating to the Query tab of a corpus and selecting Retrieval.
Scale users have a drop-down menu to select different rerankers.