Okapi BM25

In information retrieval, Okapi BM25 (BM stands for Best Matching) is a ranking function used by search engines to rank matching documents according to their relevance 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 name of the actual ranking function is BM25. To set the right context, however, it usually referred to as “Okapi BM25”, since the Okapi information retrieval system, implemented at London’s City University in the 1980s and 1990s, was the first system to implement this function.
BM25, and its newer variants, e.g. BM25F (a version of BM25 that can take document structure and anchor text into account), represent state-of-the-art TF-IDF-like retrieval functions used in document retrieval.

Contents

1 The ranking function
2 IDF information theoretic interpretation
3 Modifications
4 Footnotes
5 References
6 External links

The ranking function[edit]
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 the inter-relationship between the query terms within a document (e.g., their relative proximity). It is not a single function, but actually a whole family of scoring functions, with slightly different components and parameters. One of the most prominent instantiations of the function is as follows.
Given a query Q, containing keywords

q

1

,
.
.
.
,

q

n

{\displaystyle q_{1},…,q_{n}}

, the BM25 score of a document D is:

score

(
D
,
Q
)
=

i
=
1

n

IDF

(

q

i

)

f
(

q

i

,
D
)

(

k

1