arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1910.05923cs.LGcs.AIcs.SE
收藏

代码生成作为代码摘要的双重任务

Code Generation as a Dual Task of Code Summarization

Peking University(北京大学);Monash University(莫纳什大学)

Bolin Wei, Ge Li, Xin Xia, Zhiyi Fu, Zhi Jin

摘要:

代码摘要(CS)和代码生成(CG)是软件自动化开发领域中的两个关键任务。各种基于神经网络的方法被提出来分别解决这两个任务。然而,CS和CG之间存在特定的直观相关性,这在以前的工作中没有被利用。在本文中,我们应用两个任务之间的关系,以提高这两个任务的性能。换句话说,利用这两个任务之间的二元性,我们提出了一个双重训练框架来同时训练这两个任务。在这个框架中,我们考虑了概率和注意力权重的对偶性,并设计了相应的正则化项来约束对偶性。我们在从GitHub收集的两个数据集上评估了我们的方法,实验结果表明,我们的双重框架可以提高CS和CG任务的性能。

英文摘要:

Code summarization (CS) and code generation (CG) are two crucial tasks in the field of automatic software development. Various neural network-based approaches are proposed to solve these two tasks separately. However, there exists a specific intuitive correlation between CS and CG, which have not been exploited in previous work. In this paper, we apply the relations between two tasks to improve the performance of both tasks. In other words, exploiting the duality between the two tasks, we propose a dual training framework to train the two tasks simultaneously. In this framework, we consider the dualities on probability and attention weights, and design corresponding regularization terms to constrain the duality. We evaluate our approach on two datasets collected from GitHub, and experimental results show that our dual framework can improve the performance of CS and CG tasks over baselines.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑