BM25 (Best Matching 25) is a classic probabilistic information retrieval (IR) sparse term-matching algorithm; its relevance score formula is
Score(D,Q)=∑i=1nIDF(qi)⋅f(qi,D)+k1⋅(1−b+b⋅avgdl∣D∣)f(qi,D)⋅(k1+1), where
k1 (typically 1.2-2.0) caps term frequency saturation,
b (typically 0.75) tunes document length penalty, and
IDF(qi) measures global term rarity.