IDF-weighted saturated term frequency with length normalisation.
Examples
morie_kamath_bm25_score(c("cat", "dog"), c("cat", "cat", "fish"),
c(cat = 1.5, dog = 2), 3)
#> $estimate
#> [1] 2.142857
#>
#> $score
#> [1] 2.142857
#>
#> $per_term
#> cat dog
#> 2.142857 0.000000
#>
#> $term_frequencies
#> [1] 2 0
#>
#> $doc_length
#> [1] 3
#>
#> $avgdl
#> [1] 3
#>
#> $k1
#> [1] 1.5
#>
#> $b
#> [1] 0.75
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "BM25 relevance score (Kamath Ch 7)"
#>
