Helper for executing an MMR traversal query.
MmrHelper(
self,
k: int,
query_embedding: list[float],
lambda_mult: float = 0.5,
score_threshold: float = NEG_INF
)| Name | Type | Description |
|---|---|---|
query_embedding* | list[float] | The embedding of the query to use for scoring. |
lambda_mult | float | Default: 0.5Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. |
score_threshold | float | Default: NEG_INFOnly documents with a score greater than or equal this threshold will be chosen. Defaults to -infinity. |
Dimensions of the embedding.
Embedding of the query as a (1,dim) ndarray.
Number between 0 and 1.
Determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity.
1 - lambda_mult.
Only documents with a score greater than or equal to this will be chosen.
List of selected IDs (in selection order).
List of MMR score at the time each document is selected.
List of similarity score for each selected document.
(N, dim) ndarray with a row for each selected node.
Dictionary of candidate IDs to indices in candidates and candidate_embeddings.
List containing information about candidates.
Same order as rows in candidate_embeddings.
(N, dim) ndarray with a row for each candidate.