BM25S: Ordes van grootte snellere lexicale zoekopdrachten via eager sparse scoring
BM25S: Orders of magnitude faster lexical search via eager sparse scoring
July 4, 2024
Auteurs: Xing Han Lù
cs.AI
Samenvatting
We introduceren BM25S, een efficiënte Python-implementatie van BM25 die
alleen afhankelijk is van Numpy en Scipy. BM25S behaalt een snelheidswinst van
tot 500x vergeleken met het meest populaire Python-framework door BM25-scores
tijdens het indexeren direct te berekenen en op te slaan in sparse matrices. Het
behaalt ook aanzienlijke snelheidswinsten vergeleken met sterk geoptimaliseerde
Java-implementaties, die worden gebruikt door populaire commerciële producten.
Ten slotte reproduceert BM25S de exacte implementatie van vijf BM25-varianten
gebaseerd op Kamphuis et al. (2020) door directe scoreberekening uit te breiden
naar niet-sparse varianten met behulp van een nieuwe score-shiftmethode. De
code is te vinden op https://github.com/xhluca/bm25s.
English
We introduce BM25S, an efficient Python-based implementation of BM25 that
only depends on Numpy and Scipy. BM25S achieves up to a 500x speedup compared
to the most popular Python-based framework by eagerly computing BM25 scores
during indexing and storing them into sparse matrices. It also achieves
considerable speedups compared to highly optimized Java-based implementations,
which are used by popular commercial products. Finally, BM25S reproduces the
exact implementation of five BM25 variants based on Kamphuis et al. (2020) by
extending eager scoring to non-sparse variants using a novel score shifting
method. The code can be found at https://github.com/xhluca/bm25s