arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2004.02843cs.SEcs.CL
收藏

基于图神经网络的代码摘要改进

Improved Code Summarization via a Graph Neural Network

University of Notre Dame(圣母大学);IBM Research(IBM研究院)

Alexander LeClair, Sakib Haque, Lingfei Wu, Collin McMillan

摘要:

自动源代码摘要是为源代码生成自然语言描述的任务。自动代码摘要是一个快速扩展的研究领域,特别是随着社区更好地利用神经网络和AI技术的进步。通常,源代码摘要技术使用源代码作为输入并输出自然语言描述。然而,一个强烈的共识是,使用结构信息作为输入导致改进的性能。使用结构信息的第一种方法将AST扁平化为序列。最近,基于随机AST路径或图神经网络的更复杂的方法已经改进了使用扁平化AST的模型。然而,文献仍然没有描述将图神经网络与源代码序列一起用作模型的单独输入。因此,在本文中,我们提出了一种使用基于图的神经架构的方法,该架构可以更好地匹配AST的默认结构来生成这些摘要。我们使用210万Java方法-注释对的数据集来评估我们的技术,并显示了对四种基线技术的改进,其中两种来自软件工程文献,两种来自机器学习文献。

英文摘要:

Automatic source code summarization is the task of generating natural language descriptions for source code. Automatic code summarization is a rapidly expanding research area, especially as the community has taken greater advantage of advances in neural network and AI technologies. In general, source code summarization techniques use the source code as input and outputs a natural language description. Yet a strong consensus is developing that using structural information as input leads to improved performance. The first approaches to use structural information flattened the AST into a sequence. Recently, more complex approaches based on random AST paths or graph neural networks have improved on the models using flattened ASTs. However, the literature still does not describe the using a graph neural network together with source code sequence as separate inputs to a model. Therefore, in this paper, we present an approach that uses a graph-based neural architecture that better matches the default structure of the AST to generate these summaries. We evaluate our technique using a data set of 2.1 million Java method-comment pairs and show improvement over four baseline techniques, two from the software engineering literature, and two from machine learning literature.

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

↑