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

unhashable type: 'matrix' #6

Open
vinayakumarr opened this issue Oct 24, 2019 · 0 comments
Open

unhashable type: 'matrix' #6

vinayakumarr opened this issue Oct 24, 2019 · 0 comments

Comments

@vinayakumarr
Copy link

The below code in model_test.py generates the following error

most_similar_dist(ppmi, positive=['reproduction'], negative=[], topn=3)


TypeError Traceback (most recent call last)
in
----> 1 most_similar_dist(ppmi, positive=['reproduction'], negative=[], topn=3)

/mnt/50c93f6b-d279-4699-abe2-5ac73a36bedf/Vinay/similar_word.py in most_similar_dist(model, positive, negative, topn)
43 best = numpy.argsort(dists)[::-1][:topn + len(all_words)]
44
---> 45 result = [(model.id2word[sim], float(dists[sim])) for sim in best if sim not in all_words]
46
47 return result[:topn]

/mnt/50c93f6b-d279-4699-abe2-5ac73a36bedf/Vinay/similar_word.py in (.0)
43 best = numpy.argsort(dists)[::-1][:topn + len(all_words)]
44
---> 45 result = [(model.id2word[sim], float(dists[sim])) for sim in best if sim not in all_words]
46
47 return result[:topn]

TypeError: unhashable type: 'matrix'

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