NeuralDialog-CVAE icon indicating copy to clipboard operation
NeuralDialog-CVAE copied to clipboard

How can I ignore <unk> tokens while decoding?

Open dimeldo opened this issue 6 years ago • 3 comments

Hi, how can I ignore unk tokens while decoding? It probably just means setting the weight to zero.

So I want to do something like this:

if ignore_unk:
    next_probs[:, self.unk_id] = 0

How can I do this in your code?

Thanks.

dimeldo avatar Dec 26 '17 10:12 dimeldo

You can probably modify the decoding function inside: NeuralDialog-CVAE/models/decoder_fn_lib.py

snakeztc avatar Mar 12 '18 14:03 snakeztc

Is there a way you can implement that? I don't know how to do that myself.

dimeldo avatar Mar 17 '18 14:03 dimeldo

?

dimeldo avatar Apr 03 '18 14:04 dimeldo