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

analogy returns NaNs when none of its inputs exist in its corpus #9

Open
altayhunter opened this issue May 29, 2022 · 0 comments
Open

Comments

@altayhunter
Copy link

analogy has a return type of Option<_> and takes care to return None if it's passed two empty vectors. However, it doesn't bother to check whether vectors.is_empty() and instead ends up returning the top entries from its corpus with scores of NaN as a result.

Fixing this should be as simple as changing this line to if exclude.is_empty() || vectors.is_empty() {.

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