
Dense passage retrieval top-k (Kamath Ch 7)
Source:R/kamath_llm2_native.R
morie_kamath_dense_passage_retrieval.RdBi-encoder dot products with a STABLE top-k; indices are 0-BASED.
Examples
morie_kamath_dense_passage_retrieval(q_embed = 5L, p_embeds = c(1, 2, 3, 4, 5, 6, 7, 8), k = 5L)
#> $estimate
#> [1] 40
#>
#> $top_k_indices
#> [1] 7 6 5 4 3
#>
#> $top_k_scores
#> [1] 40 35 30 25 20
#>
#> $scores
#> [1] 5 10 15 20 25 30 35 40
#>
#> $k
#> [1] 5
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "dense passage retrieval top-k (Kamath Ch 7)"
#>