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

Replace division in math.log() with subtraction #23

Merged

Conversation

Witiko
Copy link
Contributor

@Witiko Witiko commented Mar 31, 2022

In the _calc_idf() method of BM25Plus, a division is used in math.log(), which is less stable than a subtraction of two logarithms. This PR replaces the division with subtraction,

@Witiko Witiko changed the title Replace division in log() with subtraction of two log()s Replace division in math.log() with subtraction Mar 31, 2022
@dorianbrown
Copy link
Owner

Sorry for the slow reaction, but this is a great change. I see now that I did this for the other _calc_idf methods, but not this one. Will get it merged!

@dorianbrown dorianbrown self-assigned this May 28, 2024
@dorianbrown dorianbrown self-requested a review May 28, 2024 12:16
@dorianbrown dorianbrown merged commit b447cc9 into dorianbrown:master May 28, 2024
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.

None yet

2 participants