BM25Similarity

class BM25Similarity(k1: Float = 1.2f, b: Float = 0.75f, discountOverlaps: Boolean = true) : Similarity

BM25 Similarity. Introduced in Stephen E. Robertson, Steve Walker, Susan Jones, Micheline Hancock-Beaulieu, and Mike Gatford. Okapi at TREC-3. In Proceedings of the Third Text REtrieval Conference (TREC 1994). Gaithersburg, USA, November 1994.

Constructors

Link copied to clipboard
constructor(k1: Float = 1.2f, b: Float = 0.75f, discountOverlaps: Boolean = true)
constructor(discountOverlaps: Boolean)

BM25 with these default values:

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val b: Float

Returns the b parameter

Link copied to clipboard

True if overlap tokens (tokens with a position of increment of zero) are discounted from the document's length.

Link copied to clipboard
val k1: Float

Returns the k1 parameter

Functions

Link copied to clipboard

Computes the normalization value for a field at index-time.

Link copied to clipboard
fun idfExplain(collectionStats: CollectionStatistics, termStats: Array<out TermStatistics>): Explanation

Computes a score factor for a phrase.

fun idfExplain(collectionStats: CollectionStatistics, termStats: TermStatistics): Explanation

Computes a score factor for a simple term and returns an explanation for that score factor.

Link copied to clipboard
open override fun scorer(boost: Float, collectionStats: CollectionStatistics, vararg termStats: TermStatistics): Similarity.SimScorer

Compute any collection-level weight (e.g. IDF, average document length, etc) needed for scoring a query.

Link copied to clipboard
open override fun toString(): String