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

stop list weighting is incorrect #1

Open
icarocd opened this issue Aug 21, 2017 · 0 comments
Open

stop list weighting is incorrect #1

icarocd opened this issue Aug 21, 2017 · 0 comments

Comments

@icarocd
Copy link

icarocd commented Aug 21, 2017

In com.crtomirmajer.wmd4j.WordMovers, the weighting is wrong when stopwords are set. A simple scenario is to use a set of stopwords that never happen, and check the distances computed.
It decreases the distance value even when tokenA and tokenB are not stop words. stopwordWeight should be multiplied when one or both are. A quick fix is to change line 69 to:
stopwords.contains(tokenA) || stopwords.contains(tokenB) ? stopwordWeight : 1

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

No branches or pull requests

1 participant