OpenNMT / CTranslate

Lightweight C++ translator for OpenNMT Torch models (deprecated)
https://opennmt.net/
MIT License
79 stars 50 forks source link

Fixes for max_sent_length option handling #45

Closed jhnwnd closed 5 years ago

jhnwnd commented 5 years ago

This PR removes the effect of the option max_sent_length on the source input (it removes the reduction of the size of batch_ids). It also fixes the possible repetition of translations (when n_best > 1 and max_sent_length is less than the length of what the translations would be if they were unrestricted by sentence length) and the length of the translations (fixes max_sent_length > 2 producing translations of length not greater than max_sent_length - 2 and max_sent_length <= 2 producing empty translations).

guillaumekln commented 5 years ago

Thanks, this makes sense.