Page 33 - 《软件学报》2021年第6期
P. 33

邝砾  等:大粒度 Pull Request 描述自动生成                                                    1607


             注意到,Liu 等人的方法在准确度上取得了最佳的效果.我们分析,这是因为该方法使用的是抽象式摘要生
         成模型,生成的 PR 描述长短不受源文档中的句子的长度所限制,可以只提取句子中的关键词.而其他几种方法,
         包括我们所提出的方法都是抽取式方法,需要抽取原文中的整个句子.虽然我们的方法能够比 Liu 等人的方法
         捕捉到更多的关键信息,但是我们生成的 PR 描述的长度受原句的限制,因此模型选取的句子在包含了大量有效
         信息的同时,也有可能包含一些无关信息,故而我们方法的准确度不及 Liu 等人的方法.但是从总体(F1)上看,我
         们的方法还是更优的.
             同时,我们还注意到:相比于使用交叉熵函数作为损失函数,使用强化学习的方法以牺牲一定程度的召回率
         为代价,得到了准确率的提升.但是这种牺牲是值得的,因为从总体(F1)上看,使用强化学习还是对模型有所优化
         的.此外,实验发现:使用采样方法(A),会使我们的方法退化成 LeadCM.我们推测,其原因可能是使用交叉熵作为
         损失函数训练出的模型选择源文档前 3 个句子的概率较大,在使用强化学习模型进一步对模型参数进行调整
         后,会进一步放大这种倾向性,因此使模型退化成了 LeadCM.
         4.3   实例分析
             本节将通过实例验证我们提出的方法在大粒度的 PR 描述生成上的优越性.
             (1)  实例 1
             PR 原文:
             Added value  ‘unknown’ for  ‘repository depth option’.  〈cm-sep〉 added a test case for  verifying that  depth
         ‘unknown’ works.  〈cm-sep〉 [jenkins-0] changed ‘undefined’ to ‘as-it-is’ in Web interface of  subversion-plugin.
         〈cm-sep〉 [jenkins-0] move ‘as-it-is’ option to the end. 〈cm-sep〉 [jenkins-0] updated help page so it refers to ‘as-it-is’
         instead uf ‘unknown’. 〈para-sep〉 enable version mode. Do initial update with infinite depth and check that subdir
         exists. Simulate job using ‘svn update--set-depth=files’ and check that subdir no longer exists. Trigger new build
         with depth unknown and check that subdir still does not exist.
             真实 PR 描述:
             I added value ‘unknown’ for ‘repository depth option’ in subversion-plugin this allows a job to reduce size of
         working copy by executing ‘svn update--set-depth=...’ and have this reduction preserved when job runs again on the
         same node.
             HGPRG-RL:
             Added value ‘unknown’ for ‘repository depth option’.
             Enable version  mode  do initial update  with  infinite depth and  check that subdir exists  simulate job  using
         ‘svnupdate--set-depth=files’ and check that subdir no longer exists trigger new build with depth unknown and check
         that subdir still does not exist.
             [jenkins-0] updated help page so it refers to ‘as-it-is’ instead uf ‘unknown’.
             PG+RL:
             Added value ‘unknown unknown’ for ‘repository depth option’.
             在实例 1 中,该 PR 源文档中包含了 5 条 commit message 和一条 code comment.真实 PR 描述是由创建该
         PR 的项目贡献者人工书写的.从真实 PR 描述中可以看出,该 PR 作出的主要更改是在 subversion-plugin 中为
         “repository depth option”添加了“unknown”值.这样做的目的是允许任务通过执行“svn update--set-depth=...”命
         令减少需要复制的内容,并且任务在相同节点再次执行时,可以同样减少内容复制.如此一来,可以减少内存的
         消耗,提高运行效率.PG+RL 是使用 Liu 等人的方法生成的 PR 描述,可以看到其方法仅捕捉到了为“repository
         depth option”添加了“unknown”值这一条有效信息,且还有重复生成词“unknown”的错误出现.而 HGPRG-RL 是
         利用我们的方法生成的 PR 描述,其不止捕捉到了为“repository depth option”添加了“unknown”值的关键信息,还
         捕捉到了检查“subdir exists.simulate”作业是否使用“svn update--set-depth=files”执行这一关键信息.
             (2)  实例 2
   28   29   30   31   32   33   34   35   36   37   38