Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaximalMarginalRelevance ¶
func MaximalMarginalRelevance( queryEmbedding []float32, embeddingList [][]float32, lambdaMult float32, k int, ) ([]int, error)
MaximalMarginalRelevance implements the Maximal Marginal Relevance algorithm. It takes a query embedding, a list of embeddings, a lambda multiplier, and a number of results to return. It returns a list of indices of the embeddings that are most relevant to the query. See https://www.cs.cmu.edu/~jgc/publication/The_Use_MMR_Diversity_Based_LTMIR_1998.pdf Implementation borrowed from LangChain https://github.com/langchain-ai/langchain/blob/4a2f0c51a116cc3141142ea55254e270afb6acde/libs/langchain/langchain/vectorstores/utils.py
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.