-
Notifications
You must be signed in to change notification settings - Fork 2k
Attention visualization #358
Comments
@yapingzhao |
@hpulfc Dear, where I can find the final_state and alignments? thanks |
@JulianZhang def _create_attention_images_summary(final_context_state):
pass |
@hpulfc can you please elaborate how to visualize the attention matrix for particular source and target sentence ? |
you can backtrace function : plot_attention in this notebook - https://github.com/tensorflow/tensorflow/blob/r1.11/tensorflow/contrib/eager/python/examples/nmt_with_attention/nmt_with_attention.ipynb. Do let me know if it doesn't work for you. |
@ranjita-naik i tried but it won't work. As I have trained my model and i have corresponding translated file too using tensorflow nmt . I want to view attention of those any of input and output sentences. Would you please suggest how to visualize the attention on tensorflow nmt. Thank you in advance. |
@kritinemkul, what's the error? as shown in the evaluate(sentence, encoder, decoder, inp_lang, targ_lang, max_length_inp, max_length_targ) function, are you collecting attention weights during inference? |
@ranjita-naik, this only works for the pairs which are printed in third cell and there is nothing any like development set and test set. If i gave the sentence other than the printed it will give error of unknown keyword. What i want is, trained the model and infer the out put sentences too as shown in the nmt tutorial. I am unable to show attention for those sentences. Is there any way to visualize attention for those sentence in tensorboard on in command prompt or in any way? |
Hi,
What is the command to get the alignments between source and target sentences ?
Looking forward to your advice or answers.
Best regards,
Thank you very much!
The text was updated successfully, but these errors were encountered: