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

I got AssertionError when checking the similarity. #41

Open
kohei0219 opened this issue Jun 25, 2022 · 0 comments
Open

I got AssertionError when checking the similarity. #41

kohei0219 opened this issue Jun 25, 2022 · 0 comments

Comments

@kohei0219
Copy link

Hello!!
Thank you for providing the great library.

I tried to check the nearest_neighbors after I trained a model.
Then, AssertionError was shown in here.
The reason is that all elements of in_vs are 0, so the result of norm is also 0.

The model that I produced has 5 meanings for each word.
I guessed that a word that was checked only had less than 5 meanings. Is this interpretation correct?

In order to run the function, I used below code instead of @Assert.

if isnan(sim[s, v]) sim[s, v] = -Inf end

The result was what I expected.

nearest_neighbors(vm, dict, "apple", 1, 10)
("peach", 1, 0.957842), ("plum", 1, 0.952987), ("cherry", 1, 0.94981), ("lemon", 5, 0.947042), ("pear", 1, 0.945165), ("sweet", 2, 0.943617), ("quince", 1, 0.942606), ("blackberry", 1, 0.94111), ("melon", 1, 0.940196), ("pomegranate", 1, 0.940196)

I'm using Julia version 1.1.1. I think your project runs correctly if you modified this part.

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