Skip to content
ML Academy

Introduced on day 48

BM25

A lexical ranking function that scores a document by matching query terms, weighted by term rarity, with saturating term frequency and length normalisation.

In detail

For each query term, BM25 multiplies an inverse-document-frequency weight by a saturating term-frequency factor that is normalised by document length. It needs no training, handles exact identifiers well and is a strong first baseline; it cannot match a query that shares no words with the passage.