| 摘要: |
| 在GitHub平台中,许多项目贡献者在提交Pull Request(PR)时往往会忽略提交PR描述,这使得提交的PR容易被评审者忽略或者拒绝.因此,自动生成PR描述以帮助项目贡献者提高PR通过率是很有必要的.然而,现有PR描述生成方法的表现会受到PR粒度影响,无法有效为大粒度的PR生成描述.因此,该工作专注于大粒度PR描述的自动生成.首先对PR中的文本信息进行预处理,将文本中的单词作为辅助节点构建词-句异质图,以建立PR语句间的联系;随后对异质图进行特征提取,并将提取后的特征输入至图神经网络进行图表示学习,通过节点间的消息传递,使句子节点学习到更丰富的内容信息;最后,选择带有关键信息的句子组成PR描述.此外,针对PR数据集缺少人工标注的真实标签而无法进行监督学习的问题,使用强化学习指导PR描述的生成,以最小化获得奖励的负期望为目标训练模型,该过程与标签无关,并且直接提升了生成结果的表现.在真实的数据集上进行了实验,实验结果表明,提出的大粒度PR描述生成方法在F1值和可读性上优于现有方法. |
| 关键词: Pull Request描述 异质图神经网络 强化学习 非结构性文档 摘要生成 |
| DOI:10.13328/j.cnki.jos.006239 |
| 分类号: |
| 基金项目:国家重点研发计划(2018YFB1003800);国家自然科学基金(61772560) |
|
| Automatic Generation of Large-Granularity Pull Request Description |
|
KUANG Li1, SHI Ru-Yi1, ZHAO Lei-Hao1, ZHANG Huan1, GAO Hong-Hao2
|
|
1.School of Computer Science and Engineering, Central South University, Changsha 410083, China;2.School of Computer Engineering and Science, Shanghai University, Shanghai 200444, China
|
| Abstract: |
| In GitHub platform, many project contributors often ignore the descriptions of pull requests (PRs) when submitting PRs, making their PRs easily neglected or rejected by reviewers. Therefore, it is necessary to generate PR descriptions automatically to help increase PR pass rate. The performances of existing PR description generation methods are usually affected by PR granularity, so it is difficult to generate descriptions for large-granularity PRs effectively. For such reasons, this work focuses on generating descriptions for large-granularity PRs. The text information is first preprocessed in PR and word-sentence heterogeneous graphs are constructed where the words are used as secondary nodes, so as to establish the connections between PR sentences. Subsequently, feature extraction is performed on the heterogeneous graphs, and then the features are input into graph neural network for further graph representation learning, from which the sentence nodes can learn more abundant content information through message delivery between nodes. Finally, the sentences with key information are selected to form a PR description. In addition, the supervised learning method cannot be used for training due to the lack of manually labeled tags in the dataset, therefore, reinforcement learning is used to guide the generation of PR descriptions. The goal of model training is minimizing the negative expectation of rewards, which does not require the ground truth and directly improves the performance of the results. The experiments are conducted on real dataset and the experimental results show that the proposed method is superior to existing methods in F1 and readability. |
| Key words: Pull Request description heterogeneous graph neural network reinforcement learning unstructured document summarization generation |