Page 296 - 《软件学报》2026年第2期
P. 296

张建新 等: 依存句法信息增强的完全非自回归翻译                                                         775


                 试样本为例, 见表     9. 对其使用  SuPar 进行解析后得到句法树如图         8  所示. 两个向量的内积表示这两个向量的相关
                 性  [81] , 我们计算了  GLAT  和  SynNAT  的编码器输出的不同词元的向量       h en  的内积, 并画出热力图, 如图    9  所示, 颜
                                                                         i
                 色越深表示越相关. 图      10 为这两个句子的使用       GLAT  和  SynNAT  生成的目标句子的信息熵图. 我们发现, 图         9(b)、
                 (d) 中颜色较深的方格中有比图          9(a)、9(c) 中更多的图   8  中的某些结构. 比如, 图     9(b) 中  land→welt、land→
                 einzige 等  (在热力图中的表现为颜色更深), 然而像         land→  · 这样的依存关系仍未在热力图中获得足够突出, 这说
                 明我们的方法在有效融合句法结构方面仍有改进空间. 在图                    9(a) 中, land→welt 的相关程度较低    (表现为颜色更
                 浅), 在图  10(a) 中, GLAT  没有了  welt 这个词所对应的翻译结果. 取而代之的是翻译了两次             land (land  的翻译结果
                 为  country). 我们使用香农熵来衡量它们对词汇预测的不确定性. 熵值越大表示模型的预测越不确定, 即其概率分
                 布较为均匀, 意味着该词的置信度较低; 相反, 熵值越小表示模型的预测较为集中, 置信度较高. 我们通过颜色深浅
                 来可视化这种不确定性, 颜色越深表示熵越高               (不确定性越大), 颜色越浅表示熵越低          (不确定性越小). 通过信息熵
                 可以看到, GLAT    模型在第   2  次翻译  country  时是更不确定的    (表现为颜色更深). 在图      9(c) 中, 我们也观察到了
                 图  8(b) 中的某些结构. 比如   lang→jahre、jahre→drei 等. 在图  9(d) 中, 还发现了  tat→es. 而在图  9(c) 中  tat→es 的相
                 关程度较低. 在图     10(b) 中, GLAT  没有了  es 这个词所对应的翻译结果. es 应翻译成       it 的地方翻译成了     for, 其对应
                 的信息熵更高, 表示模型对于该地方翻译成              for 是更不确定的.

                                          表 9 蒸馏的    IWSLT14 DE→EN  测试样本研究

                                 模型                    示例 1                      示例 2
                                source           das einzige land der welt.  sie tat es drei jahre lang.
                               reference       the only country in the world.  she did it for three years.
                                GLAT             the only country country.  she did for three years.
                               SynNAT          the only country in the world.  she did it for three years.



                                    root                           root                  punct
                          det                        punct                             advmod
                                                 nmod           nsubj    obj       nummod    nmod
                                             det
                              amod
                  das    einzige     land     der  welt   ·   sie  tat    es     drei     jahre  land  ·
                         (a) 表9中ൕ২1的源句子对应依存句法树                       (b) 表9中ൕ২2的源句子对应依存句法树
                                              图 8 表   9  中源句子对应依存句法树



                                                          1.0                                      1.0
                       das  0.9  0.3  0.2  0.3  0.1  0.5        das  1.0  0.1  0.3  0.1  0.1  0.2
                                                          0.8                                      0.8
                     einzige  0.3  0.9  0.1  0.1  0  0.2      einzige  0.1  0.9  0.2  0.1  0.1  0.1
                       land  0.2  0.1  0.9  0.2  0.1  0.1  0.6  land  0.3  0.2  0.8  0.1  0.2  0   0.6

                       der  0.3  0.1  0.2  0.9  0.2  0.2  0.4   der  0.1  0.1  0.1  0.9  0.3  0.1  0.4

                       welt  0.1  0  0.1  0.2  0.9  0.1         welt  0.1  0.1  0.2  0.3  1.0  0.1
                                                          0.2                                      0.2
                         ·  0.5  0.2  0.1  0.2  0.1  0.9          ·  0.2  0.1  0  0.1  0.1  0.6
                                                          0                                        0
                           das  einzige  land  der  welt  ·         das  einzige  land  der  welt  ·
                                 (a) GLAT encoder对表9中的                   (b) SynNAT encoder 对表9中的
                               ൕ২ 1 编码后的词元之间的内积                         ൕ২ 1 编码后的词元之间的内积

                                   图 9 译文不同情况下不同编码器输出的词元之间的内积案例分析
   291   292   293   294   295   296   297   298   299   300   301