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

GN- Transformer:融合序列和图表示的改进代码摘要

GN-Transformer: Fusing Sequence and Graph Representation for Improved Code Summarization

University of Southern California(南加州大学)

Junyan Cheng, Iordanis Fostiropoulos, Barry Boehm

摘要:

与自然语言相反,源代码理解受标记之间的语法关系的影响,而不管它们的标识符名称。源代码的图形表示(如抽象树(AST))可以捕获标记之间的关系,这些关系在源代码中并不明显。我们提出了一种新的方法,GN-Transformer在融合序列和图形模态上学习端到端,我们称之为Syntax-Code-Graph(SCG)。GN-Transformer使用自注意机制扩展了图网络(GN)框架。SCG是源代码片段和AST表示之间早期融合的结果。我们对SCG的结构进行了实验,对模型设计进行了消融研究,并得出结论,性能优势来自融合表示。所提出的方法在两个代码摘要数据集和三个自动代码摘要度量(BLEU,METEOR,ROUGE-L)上实现了最先进的性能。我们进一步评估我们的模型和以前的工作与专家用户的研究人类感知质量。我们的模型在人类感知质量和准确性方面优于最先进的技术。

英文摘要:

As opposed to natural languages, source code understanding is influenced by grammatical relationships between tokens regardless of their identifier name. Graph representations of source code such as Abstract Syntax Tree (AST) can capture relationships between tokens that are not obvious from the source code. We propose a novel method, GN-Transformer to learn end-to-end on a fused sequence and graph modality we call Syntax-Code-Graph (SCG). GN-Transformer expands on Graph Networks (GN) framework using a self-attention mechanism. SCG is the result of the early fusion between a source code snippet and the AST representation. We perform experiments on the structure of SCG, an ablation study on the model design, and the hyper-parameters to conclude that the performance advantage is from the fused representation. The proposed methods achieve state-of-the-art performance in two code summarization datasets and across three automatic code summarization metrics (BLEU, METEOR, ROUGE-L). We further evaluate the human perceived quality of our model and previous work with an expert-user study. Our model outperforms the state-of-the-art in human perceived quality and accuracy.

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

↑