NormXU / ERNIE-Layout-Pytorch

An unofficial Pytorch implementation of ERNIE-Layout which is originally released through PaddleNLP.
http://arxiv.org/abs/2210.06155
MIT License
99 stars 11 forks source link

different label pad token id between layoutxlm and ernie layout #8

Closed vanpersie32 closed 1 year ago

vanpersie32 commented 1 year ago

Hi, I find that the label_pad_token id is different between layoutxlm and ernie layout in token classification. In layoutxlm, the label_pad_token id is -100 and will be ignored by pytorch loss functions url. However the label_pad_token id is 0 in ernie layout and will be calculated loss. url2

NormXU commented 1 year ago

Thanks for pointing out the bug. I've fixed it.