Showing individual token and corresponding score during beam search
## Who can help
@patrickvonplaten

## Information

Hello,
 
I am using beam search with a pre-trained T5 model for summarization. I would like to visualize the beam search process by showing the tokens with the highest scores, and eventually the chosen beam like this diagram:
![image](https://user-images.githubusercontent.com/35655790/108174867-fc4eda00-713a-11eb-8565-dc3b0c87cf14.png)
(Taken from https://huggingface.co/blog/how-to-generate)
 
**I am unsure how I can show the tokens and their corresponding scores.**
 
I followed the discussion https://discuss.huggingface.co/t/announcement-generationoutputs-scores-attentions-and-hidden-states-now-available-as-outputs-to-generate/3094 and https://github.com/huggingface/transformers/pull/9150.
 
Following the docs, upon calling `generate`, I have set `return_dict_in_generate=True`, `output_scores=True`
 
```
generated_outputs = model_t5summary.generate(
  input_ids=input_ids.to(device),
  attention_mask=features['attention_mask'].to(device),
  max_length=input_ids.shape[-1] + 2,
  return_dict_in_generate=True,
  output_scores=True,
  output_hidden_states=True,
  output_attentions=True,
  no_repeat_ngram_size=2,
  early_stopping=True,
  num_return_sequences=3,
  num_beams=5,
)
```
 
Now I have an instance of `BeamSearchEncoderDecoderOutput`.
 
If I understand the docs (https://huggingface.co/transformers/master/internal/generation_utils.html#generate-outputs) correctly, `scores` will provide me with what I want but I am unsure on how to use the `scores`.

Any help/pointers from the community would be greatly appreciated, thank you 🙏 
Hey @monmanuela,

Thanks for checking out the post! We try to keep the repository for github issues and kindly ask you to post these kinds of questions on the [forum](https://discuss.huggingface.co/). Feel free to tag me there (@patrickvonplaten) :-)<|||||>@patrickvonplaten thanks for your quick reply! Posted a topic on the forum, closing this issue.