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

more expression #2

Open
hoenza opened this issue Jul 31, 2019 · 1 comment
Open

more expression #2

hoenza opened this issue Jul 31, 2019 · 1 comment

Comments

@hoenza
Copy link

hoenza commented Jul 31, 2019

Could you please, describe more beam search decoding ?

@budzianowski
Copy link
Owner

The algorithm generates the sentence using the beam search based on the priority queue (line 96). The while loop works until top-k sentences are generated (the generation of the sentence is finished if the model outputs the EOS token) (line 103). In the loop, we take the sequence with the highest probability (line 108) and pass it through decoder given the history (line 121).
Given the beam width we add new hypotheses to the queue and move to the next probable path.
In line 147 we traverse back the queue to generate the most probable sentences.

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