Commit a04c4cf4 authored by Myle Ott's avatar Myle Ott
Browse files

Fix --remove-bpe to strip trailing BPE symbols

parent c53b2ee0
......@@ -59,7 +59,7 @@ class Dictionary(object):
sent = ' '.join(token_string(i) for i in tensor if i != self.eos())
if bpe_symbol is not None:
sent = sent.replace(bpe_symbol, '')
sent = (sent + ' ').replace(bpe_symbol, '').rstrip()
return sent
def unk_string(self, escape=False):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment