maximal_marginal_relevance#
- langchain_milvus.vectorstores.milvus.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) – The query embedding.
embedding_list (list) – The list of embeddings.
lambda_mult (float) – The lambda multiplier. Defaults to 0.5.
k (int) – The number of results to return. Defaults to 4.
- Returns:
The list of indices.
- Return type:
List[int]