tensorflow / nmt

TensorFlow Neural Machine Translation Tutorial
Apache License 2.0
6.38k stars 1.96k forks source link

How to choose second or third likely word as the output #440

Open ryan-minyu opened 5 years ago

ryan-minyu commented 5 years ago

Like this issue https://github.com/tensorflow/nmt/issues/219#issue-284092935

Generally, we choose the most likely word, the id associated with the maximum logit value, as the emitted word (this is the "greedy" behavior). But in some cases, I want to choose the least likely word as the output, how should I modify the code?

I have a similar question. How to select the second, third ... likely word?