diff --git a/onmt/bin/build_vocab.py b/onmt/bin/build_vocab.py index 6f2611a5e8..a9bbe7e7cb 100644 --- a/onmt/bin/build_vocab.py +++ b/onmt/bin/build_vocab.py @@ -65,9 +65,9 @@ def build_sub_vocab(corpora, transforms, opts, n_sample, stride, offset): if 'feats' in maybe_example['src']: src_feats_lines = maybe_example['src']['feats'] - for i in range(opts.n_src_feats): - sub_counter_src_feats[i].update( - src_feats_lines[i].split(' ')) + for k in range(opts.n_src_feats): + sub_counter_src_feats[k].update( + src_feats_lines[k].split(' ')) else: src_feats_lines = []