langchain_community.vectorstores.utils
.maximal_marginal_relevanceΒΆ
- langchain_community.vectorstores.utils.maximal_marginal_relevance(query_embedding: ndarray, embedding_list: list, lambda_mult: float = 0.5, k: int = 4) List[int] [source]ΒΆ
Calculate maximal marginal relevance.
- Parameters
query_embedding (ndarray) β
embedding_list (list) β
lambda_mult (float) β
k (int) β
- Return type
List[int]