Open wcshin-git opened 3 years ago
We used the NATS package for all the experiments in the paper. Please check https://github.com/tshi04/NATS. This is a new implementation of the codes and results in README are obtained based on this version. Thanks for pointing the problem out and we have fixed it.
Hi, I found a bug in the
word_copy()
inmodel_deq2seq_base.py
.The purpose of
word_copy()
is to replace the generated<unk>
with a token in the source text. So we need an attn score how much the<unk>
attend the source tokens.But
wdidx[j]
is not correct correspondence ofgen_txt[j]
when using beam search. It's correct correspondence when beam size = 1. The reason is thatmyseq.shape[0] != myattn.shape[0]+1
(for eg, 13 != 66+1. If you set the beam size 1,myattn.shape[0]
will be 12) If you set beam size > 1, there won't be an error, but the copy mechanism doesn't work properly.