|
|
Line 1: |
Line 1: |
| In [[information retrieval]], '''Okapi BM25''' is a [[ranking function]] used by [[search engine]]s to rank matching documents according to their [[Relevance (information retrieval)|relevance]] to a given search query. It is based on the [[Probabilistic relevance model|probabilistic retrieval framework]] developed in the 1970s and 1980s by [[Stephen E. Robertson]], [[Karen Spärck Jones]], and others.
| | Golda is what's created on my birth certification even though it is not the title on my beginning certification. Alaska is exactly where he's always been living. Doing ballet is some thing she would by no means give up. For years she's been operating as a journey agent.<br><br>Feel free to visit [http://www.chk.woobi.co.kr/xe/?document_srl=346069 authentic psychic readings] my web blog good [http://srncomm.com/blog/2014/08/25/relieve-that-stress-find-a-new-hobby/ authentic psychic readings] ([http://help.ksu.edu.sa/node/65129 Privacy of Data: This tool is built-with and functions-in Client Side JavaScripting, so only your computer will see or process your data input/output.a cool way to improve]) |
| | |
| 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, London|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, such as Web search.
| |
| | |
| == The ranking function ==
| |
| | |
| BM25 is a [[Bag of words model|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 <math>Q</math>, containing keywords <math>q_1, ..., q_n</math>, the BM25 score of a document <math>D</math> is:
| |
| | |
| :<math> \text{score}(D,Q) = \sum_{i=1}^{n} \text{IDF}(q_i) \cdot \frac{f(q_i, D) \cdot (k_1 + 1)}{f(q_i, D) + k_1 \cdot (1 - b + b \cdot \frac{|D|}{\text{avgdl}})},</math>
| |
| | |
| where <math>f(q_i, D)</math> is <math>q_i</math>'s [[term frequency]] in the document <math>D</math>, <math>|D|</math> is the length of the document <math>D</math> in words, and <math>avgdl</math> is the average document length in the text collection from which documents are drawn. <math>k_1</math> and <math>b</math> are free parameters, usually chosen, in absence of an advanced optimization, as <math>k_1 \in [1.2,2.0]</math> and <math>b = 0.75</math>.<ref>Christopher D. Manning, Prabhakar Raghavan, Hinrich Schütze. ''An Introduction to Information Retrieval'', Cambridge University Press, 2009, p. 233.</ref> <math>\text{IDF}(q_i)</math> is the IDF ([[inverse document frequency]]) weight of the query term <math>q_i</math>. It is usually computed as: | |
| | |
| :<math>\text{IDF}(q_i) = \log \frac{N - n(q_i) + 0.5}{n(q_i) + 0.5},</math>
| |
| | |
| where <math>N</math> is the total number of documents in the collection, and <math>n(q_i)</math> is the number of documents containing <math>q_i</math>.
| |
| | |
| There are several interpretations for IDF and slight variations on its formula. In the original BM25 derivation, the IDF component is derived from the [[Binary Independence Model]].
| |
| | |
| Please note that the above formula for IDF shows potentially major drawbacks when using it for terms appearing in more than half of the corpus documents. These terms' IDF is negative, so for any two almost-identical documents, one which contains the term and one which does not contain it, the latter will possibly get a larger score.
| |
| This means that terms appearing in more than half of the corpus will provide negative contributions to the final document score. This is often an undesirable behavior, so many real-world applications would deal with this IDF formula in a different way:
| |
| | |
| * Each summand can be given a floor of 0, to trim out common terms;
| |
| * The IDF function can be given a floor of a constant <math>\epsilon</math>, to avoid common terms being ignored at all;
| |
| * The IDF function can be replaced with a similarly shaped one which is non-negative, or strictly positive to avoid terms being ignored at all.
| |
| | |
| == IDF Information Theoretic Interpretation ==
| |
| Here is an interpretation from information theory. Suppose a query term <math>q</math> appears in <math>n(q)</math> documents. Then a randomly picked document <math>D</math> will contain the term with probability <math>\frac{n(q)}{N}</math> (where <math>N</math> is again the cardinality of the set of documents in the collection). Therefore, the [[information]] content of the message "<math>D</math> contains <math>q</math>" is:
| |
| | |
| :<math>-\log \frac{n(q)}{N} = \log \frac{N}{n(q)}.</math>
| |
| | |
| Now suppose we have two query terms <math>q_1</math> and <math>q_2</math>. If the two terms occur in documents entirely independently of each other, then the probability of seeing both <math>q_1</math> and <math>q_2</math> in a randomly picked document <math>D</math> is:
| |
| | |
| :<math>\frac{n(q_1)}{N} \cdot \frac{n(q_2)}{N},</math>
| |
| | |
| and the information content of such an event is:
| |
| | |
| :<math>\sum_{i=1}^{2} \log \frac{N}{n(q_i)}.</math>
| |
| | |
| With a small variation, this is exactly what is expressed by the IDF component of BM25.
| |
| | |
| == Modifications ==
| |
| * At the extreme values of the coefficient <math>b</math> BM25 turns into ranking functions known as '''BM11''' (for <math>b=1</math>) and '''BM15''' (for <math>b=0</math>).<ref>http://xapian.org/docs/bm25.html</ref>
| |
| * '''BM25F'''<ref>Hugo Zaragoza, Nick Craswell, Michael Taylor, Suchi Saria, and Stephen Robertson. [http://trec.nist.gov/pubs/trec13/papers/microsoft-cambridge.web.hard.pdf ''Microsoft Cambridge at TREC-13: Web and HARD tracks.''] In Proceedings of TREC-2004.</ref> is a modification of BM25 in which the document is considered to be composed from several fields (such as headlines, main text, anchor text) with possibly different degrees of importance.
| |
| | |
| == Footnotes ==
| |
| {{Reflist}}
| |
| | |
| == References ==
| |
| * 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.
| |
| | |
| * Stephen E. Robertson, Steve Walker, and Micheline Hancock-Beaulieu. Okapi at TREC-7. In Proceedings of the Seventh Text REtrieval Conference. Gaithersburg, USA, November 1998.
| |
| | |
| * Karen Spärck Jones, Steve Walker, and Stephen E. Robertson. A Probabilistic Model of Information Retrieval: Development and Comparative Experiments (parts 1 and 2). Information Processing and Management, 36(6):779-840. 2000.
| |
| | |
| == External links ==
| |
| * [http://www.soi.city.ac.uk/~ser/papers/foundations_bm25_review.pdf The Probabilistic Relevance Framework: BM25 and Beyond]
| |
| * [http://nlp.uned.es/~jperezi/Lucene-BM25/ BM25 implementation for Lucene]
| |
| | |
| [[Category:Ranking functions]]
| |
| [[Category:Information retrieval]]
| |