FangShancheng / ABINet

Read Like Humans: Autonomous, Bidirectional and Iterative Language Modeling for Scene Text Recognition
Other
421 stars 72 forks source link

关于position attention的end token #27

Open yxgnahz opened 3 years ago

yxgnahz commented 3 years ago

您好!请问对于position attention设置end token的意义在哪里呢?既然position attention不是auto regressive的形式,好像并不需要一个end token来终止解码过程?

FangShancheng commented 3 years ago

Hi, @yxgnahz 主要起到预测文本长度的作用

  1. 视觉模型需要输出一个识别结果,因此需要有一个end-token说明文字的结束为止,end-token可以跟null-token等价
  2. 语言模型也需要知道文本的长度,padding mask需要知道文本的长度