Skip to content

Commit

Permalink
Fixed the problem of index out of range when n_src<i<max_rank
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin1904 committed Oct 29, 2018
1 parent 1312aca commit 7223562
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dico_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_candidates(emb1, emb2, params):
# number of source words to consider
n_src = emb1.size(0)
if params.dico_max_rank > 0 and not params.dico_method.startswith('invsm_beta_'):
n_src = params.dico_max_rank
n_src = min(params.dico_max_rank, n_src)

# nearest neighbors
if params.dico_method == 'nn':
Expand Down

0 comments on commit 7223562

Please sign in to comment.