Why do you use 'number_required' in your code? When topk=1, the beam search algorithm only generates one sentence!