Okapi BM25

In information retrieval, Okapi BM25 is a ranking function used by search engines to estimate the relevance of documents to a given search query. It is based on the probabilistic retrieval framework developed in the 1970s and 1980s by Stephen E. Robertson, Karen Spärck Jones, and others.

The ranking function

BM25 is a bag-of-words retrieval function that ranks a set of documents based on the query terms appearing in each document, regardless of their proximity within the document. It weighs each term by its inverse document frequency.

The free parameters k1 and b are usually chosen, in absence of an advanced optimization, as k1 in [1.2, 2.0] and b = 0.75. The parameter b controls how strongly the document length normalises the term frequency.

ParameterTypical value
k11.2
b0.75

See also tf-idf, the weighting BM25 refines.