RerankConfig#

class langchain_community.vectorstores.vectara.RerankConfig(reranker: str = 'none', rerank_k: int = 50, mmr_diversity_bias: float = 0.3, user_function: str = '')[source]#

Configuration for Reranker.

reranker: “mmr”, “rerank_multilingual_v1”, “udf” or “none” rerank_k: number of results to fetch before reranking, defaults to 50 mmr_diversity_bias: for MMR only - a number between 0 and 1 that determines

the degree of diversity among the results with 0 corresponding to minimum diversity and 1 to maximum diversity. Defaults to 0.3. Note: mmr_diversity_bias is equivalent 1-lambda_mult where lambda_mult is the value often used in max_marginal_relevance_search() We chose to use that since we believe it’s more intuitive to the user.

user_function: for UDF only - the user function to use for reranking.

Attributes

mmr_diversity_bias

rerank_k

reranker

user_function

Methods

__init__([reranker, rerank_k, ...])

Parameters:
  • reranker (str)

  • rerank_k (int)

  • mmr_diversity_bias (float)

  • user_function (str)

__init__(reranker: str = 'none', rerank_k: int = 50, mmr_diversity_bias: float = 0.3, user_function: str = '') None#
Parameters:
  • reranker (str)

  • rerank_k (int)

  • mmr_diversity_bias (float)

  • user_function (str)

Return type:

None

Examples using RerankConfig