Description
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'