Expand description
Maximal Marginal Relevance (MMR) diversification for semantic search results.
This module implements the MMR algorithm which selects top-k results that
balance relevance to the query with diversity among the selected items.
The trade-off is controlled by a lambda parameter: 1.0 = pure relevance,
0.0 = pure diversity.
Structs§
- Diversification
Candidate - A single candidate for diversified selection.
- Diversified
Result - A single result from the diversified selection process.
- Diversifier
Config - Configuration for the MMR diversification algorithm.
- Diversifier
Stats - Aggregate statistics across all
selectcalls made on aSemanticDiversifierinstance. - Semantic
Diversifier - Diversifies a ranked list of candidates using Maximal Marginal Relevance.
Functions§
- cosine_
similarity - Cosine similarity between two vectors.