Opennmt-py: Correction needed in opts.py for option -copy_attn_force

Created on 21 Mar 2018  路  7Comments  路  Source: OpenNMT/OpenNMT-py

Hi,
Currently the help statement in opts.py for -copy_attn_force says 'When available, train to copy'. I think it should instead be something along the lines of the relevant comment in source code 'Copy only probability for not-copied tokens'.
Thanks.

docs feature

Most helpful comment

From my reading of the code in CopyGenerator.py, I see that in -copy_attn_force, you have copy probabilities of source tokens and gen probabilities of non-copied tokens. Without -copy_attn_force, you have copy probabilities of source tokens and gen probabilities of non-unk target tokens. As to your second question, Gu, Jiatao, et al. "Incorporating copying mechanism in sequence-to-sequence learning." uses separate copy layer. If that is a better idea has to be empirically verified.

All 7 comments

Okay, we will make this documentation more clear. Are you using this feature? We thought it would be useful, but it might be better to just remove.

Okay. I am not using the feature yet. I was unsure about what it is and then tried to study the code. You may remove it if it is not needed.

I couldn't understand the use of -copy_attn_force, also -reuse_copy_attn means we will use attention layer which is used by the decoder?
Can you give some basic explanation or please point to relevant papers?

Thanks for the contribution, it is really helpful.

Thanks

Yes, -reuse_copy_attn means we reuse the attention distribution as the copy distribution. It is the approach followed by See et al in "Get to the point: Summarization with pointer-generator networks."

Thanks @ratishsp, and what about -copy_attn_force ? I am not aware of any reference which trains a separate copy layer, is that a better idea?

From my reading of the code in CopyGenerator.py, I see that in -copy_attn_force, you have copy probabilities of source tokens and gen probabilities of non-copied tokens. Without -copy_attn_force, you have copy probabilities of source tokens and gen probabilities of non-unk target tokens. As to your second question, Gu, Jiatao, et al. "Incorporating copying mechanism in sequence-to-sequence learning." uses separate copy layer. If that is a better idea has to be empirically verified.

@ratishsp if you get a chance can you PR an addendum to the doc sstring ? thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

achaitanyasai picture achaitanyasai  路  5Comments

anoidgit picture anoidgit  路  4Comments

AyaNsar picture AyaNsar  路  4Comments

Bachstelze picture Bachstelze  路  3Comments

laubonghaudoi picture laubonghaudoi  路  4Comments