dorianbrown / rank_bm25

A Collection of BM25 Algorithms in Python
Apache License 2.0
1.02k stars 86 forks source link

Mistake in the description #2

Closed BochkarevV closed 5 years ago

BochkarevV commented 5 years ago

Hello Dorian! A very nice and simple implementation of the algorithms!

However, if you just copy the code from the doc and try to run it, it doesn't work, producing a vector of three 0's.

Here is what needs to be changed: bm25 = BM25Okapi(corpus) should actually be bm25 = BM25Okapi(tokenized_corpus)

It works well after this minor change.

dorianbrown commented 5 years ago

Thanks for taking the time to create this issue, I completely missed that!

Should be fixed now.