A Python implementation of the BM25 ranking function.