How effective is it to use BM25 to rank words, to be more specific i have a dictionary of words and i want to rank only words in a document that are also in my dictionary. I want to rank all words in my dictionary for each document and then add the BM25 value of each word for the specific document.

Lets say i have a document and dictionary like this:

myDictionary=['bad', 'dangerous','hide', 'following]

['human', 'intelligence', 'computer','bad', 'dangerous'],
 ['survey', 'user', 'human', 'system', 'time', 'hide', 'following],

Now iam going to run the below BM25 formula in a loop for all words in my dictionary and then sum the results of each word to get a bm25 value for each document.


1 Answer 1


BM25 is usually used in information retrieval. In this task, you have a query and a lot of documents(maybe millions), and then you want to find a subset of these documents that are most relevant to your query. A ranking of a set of documents will be provided from the most relevant to the least.

If by efficient you mean fast in a computational way. I would say BM25 is pretty fast with respect to other algorithms that are using deep neural networks.

But if your asking if BM25 results are promising or not. This is debatable as BM25 is being used for a long time. People usually use it for the first step of ranking, then they do re-ranking with other powerful tools. It doesn't mean that BM25 is giving the best answers. But when you are dealing with thousands or millions of documents, This is a good choice in order to select only a subset of documents that have high scores with BM25 then later use a more accurate algorithm to rerank the results of BM25.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.