Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

beam search should support skip_values #176

Open
szha opened this issue Jun 27, 2018 · 2 comments
Open

beam search should support skip_values #176

szha opened this issue Jun 27, 2018 · 2 comments
Labels
discussion enhancement New feature or request

Comments

@szha
Copy link
Member

szha commented Jun 27, 2018

When decoding, a common use case is to skip some of the output values, such as padding, end-of-sequence, unknown token, etc.

@szha szha added enhancement New feature or request discussion labels Jun 27, 2018
@szha szha changed the title beam search should support skip_value beam search should support skip_values Jul 30, 2018
@szha
Copy link
Member Author

szha commented Jul 30, 2018

One possible solution is to manually set all the scores corresponding to the indices in skip_values to be negative numbers of large absolute values, so that the corresponding beams don't make the cut.

@szha
Copy link
Member Author

szha commented Jul 30, 2018

https://github.com/dmlc/gluon-nlp/blob/master/gluonnlp/model/beam_search.py#L240-L252

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant