Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I ignore <unk> tokens while decoding? #6

Open
dimeldo opened this issue Dec 26, 2017 · 3 comments
Open

How can I ignore <unk> tokens while decoding? #6

dimeldo opened this issue Dec 26, 2017 · 3 comments

Comments

@dimeldo
Copy link

dimeldo commented Dec 26, 2017

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.

@snakeztc
Copy link
Owner

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

@dimeldo
Copy link
Author

dimeldo commented Mar 17, 2018

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

@dimeldo
Copy link
Author

dimeldo commented Apr 3, 2018

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants