Enable dynamic vocabulary reduction with vmap
masterDynamic vocabulary reduction increases translation speed by limiting the target vocabulary to a subset of candidates based on the source N-grams in the current batch.
- Generate a vmap file: Create a text file where each line follows the format:
src_1 src_2 ... src_N<TAB>tgt_1 tgt_2 ... tgt_K(If the source N-gram is empty, the associated target tokens are always included). - Convert the model: Pass the mapping file to the converter using the
--vocab_mappingoption. - Translate: Enable the reduction during translation using the
use_vmapoption.