OpenNMT / CTranslate2

Fast inference engine for Transformer models
https://opennmt.net/CTranslate2
MIT License
3.28k stars 287 forks source link

Does fairseq transform align can returns the alignment result? #1668

Closed itaybar closed 2 months ago

itaybar commented 5 months ago

I am using fairseq transform align and Im trying to get the alignment results with no success. this is possible somehow?

minhthuc2502 commented 5 months ago

I think I don't have much knowledge about this. @vince62s Do you have any idea?

vince62s commented 5 months ago

it is supported I think: https://github.com/OpenNMT/CTranslate2/blob/master/docs/guides/fairseq.md?plain=1#L1-L9 but never used

itaybar commented 5 months ago

I run the model successfully but cant get the align output (an extra output in this architecture that represent the alignments)

ymoslem commented 2 months ago

My understanding is that this also applies to models trained with the guided alignment feature in OpenNMT-tf. According to issue https://github.com/OpenNMT/CTranslate2/issues/767, the feature is not explicitly available; however…

Alignments can be easily inferred from the attention vectors

For a model trained with Fairseq Transformer Align, I am not sure if this would work, but I assume it depends on the model itself.

itaybar commented 2 months ago

Its working, Thanks