Skip to content

Commit

Permalink
Update Translator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
srush authored Mar 27, 2018
1 parent 969b6d0 commit c416bc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion onmt/translate/Translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def translate_batch(self, batch, data):

# Define a list of tokens to exclude from ngram-blocking
# exclusion_list = ["<t>", "</t>", "."]
exclusion_tokens = set([vocab.stoi[t] for t in self.ignore_when_blocking])
exclusion_tokens = set([vocab.stoi[t]
for t in self.ignore_when_blocking])

beam = [onmt.translate.Beam(beam_size, n_best=self.n_best,
cuda=self.cuda,
Expand Down

0 comments on commit c416bc4

Please sign in to comment.