PyTorch-Beam-Search-Decoding
PyTorch-Beam-Search-Decoding copied to clipboard
questions about number_required
Why do you use 'number_required' in your code? When topk=1, the beam search algorithm only generates one sentence!
If you change topk to a larger number, the algorithm will generate more hypotheses as the number_required
variable is dependent on it.