Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Lample committed Apr 25, 2018
1 parent 27e193a commit 0546ef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/evaluation/word_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get_word_translation_accuracy(lang1, word2id1, emb1, lang2, word2id2, emb2,
raise Exception('Unknown method: "%s"' % method)

results = []
top_matches = scores.topk(100, 1, True)[1]
top_matches = scores.topk(10, 1, True)[1]
for k in [1, 5, 10]:
top_k_matches = top_matches[:, :k]
_matching = (top_k_matches == dico[:, 1][:, None].expand_as(top_k_matches)).sum(1)
Expand Down

0 comments on commit 0546ef8

Please sign in to comment.