How to visualize attention?

Hello,

How to go about visualizing attention using OpenNMT-py?

1 Like

Figured some way around myself.

I used Translation class and logged everything required - src, tgt, pred, attentions into a file corresponding to the batches, which worked enough for me. Once you have (src, pred, attention matrix), it’s pretty straightforward.

1 Like

Thanks for your sharing, it helps me a lot!