Where can I modify the code to change the decoding?

Hello there,

I want to modify the decoding code. Suppose that working decoding with beam size 5 as default. For every step decoder selects the top most probability words and inputs them for the next words.

Can I change these words. Actually this means I want to change word probabilities in the vocabulary while decoding.

Which file/script do I need to examine for this purpose?

Thanks in advance.

You can have a look at onmt.translate.translator and onmt.translate.beam_search.

Thanks for your answer.

I found the code that I need to modify in onmt.translate.translator, I suppose.

Good work to everyone.