Improving Code Summarization with Tree Transformer Enhanced by Position-related Syntax Complement

Jie Song, Zexing Zhang, Zirui Tang,Shi Feng,Yu Gu

IEEE Transactions on Artificial Intelligence(2024)

引用 0|浏览7
暂无评分
摘要
Code summarization aims to generate natural language summaries automatically given the source code snippet, which aids developers in understanding source code faster and improves software maintenance. Recent approaches using natural language techniques in code summarization fall short of adequately capturing the syntactic characteristics of programming languages, particularly the position-related syntax, from which the semantics of the source code can be extracted. In this paper, we present SyMer (Syntax transforMer) based on the Transformer architecture where we enhance it with position-related syntax complement to better capture syntactic characteristics. Position-related syntax complement takes advantage of unambiguous relations among code tokens in AST, as well as the gathered attention on crucial code tokens indicated by its syntactic structure. The experimental results demonstrate that SyMer outperforms state-of-the-art models by at least 2.4% (BLEU), 1.0% (METEOR) on Java benchmark and 4.8% (BLEU), 5.1% (METEOR) and 3.2% (ROUGE-L) on Python benchmark.
更多
查看译文
关键词
Tree Transformer,programming language processing,code summarization,abstract syntax tree,position-related syntax information
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要