Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the parameters of BM25+ scoring algorithm configurable #186

Merged
merged 5 commits into from
Nov 23, 2022

Conversation

lucaong
Copy link
Owner

@lucaong lucaong commented Nov 23, 2022

Resolves: #163

Although this is rarely needed, and requires a good understanding of the Okapi BM25+ scoring model, some use cases (such as non-latin scripts with a very different structure) can benefit from it.

// BM25 params can be passed as part of searchOptions in the constructor
const ms = new MiniSearch({
  fields: ['text'],
  searchOptions: { bm25: { k: 1.0, b: 0.7, d: 0.5 } }
})

// Alternatively, they can be passed as options to individual searches
ms.search('something', { bm25: { k: 1.0, b: 0.7, d: 0.5 } })

Although this is rarely needed, and requires an understanding of the
BM25+ scoring model, some use cases (such as non-latin scripts with a
very different structure) can benefit from it.
@lucaong lucaong force-pushed the customizable-bm25-params-2 branch from 70a26b2 to f269e46 Compare November 23, 2022 14:34
@lucaong lucaong merged commit b546066 into master Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support BM25 parameters customization
1 participant