langchain_aws.utilities.utils
.maximal_marginal_relevance¶
- langchain_aws.utilities.utils.maximal_marginal_relevance(query_embedding: ndarray, embedding_list: list, lambda_mult: float = 0.5, k: int = 4) List[int] [源代码]¶
计算最大边缘相关性。
- 参数
query_embedding (ndarray) –
embedding_list (list) –
lambda_mult (float) –
k (int) –
- 返回类型
List[int]