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

基于转换器的Source Code摘要生成方法

A Transformer-based Approach for Source Code Summarization

University of California, Los Angeles(加州大学洛杉矶分校);Columbia University(哥伦比亚大学)

Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, Kai-Wei Chang

摘要:

生成描述程序功能的可读摘要称为源代码摘要。在这个任务中,通过对代码标记之间的成对关系建模来学习代码表示以捕获它们的长期依赖关系是至关重要的。为了学习用于摘要的代码表示,我们探索了使用自我注意力机制的Transformer模型,该模型已被证明在捕获长距离依赖关系方面是有效的。在这项工作中,我们表明,尽管这种方法很简单,但它的性能明显优于最先进的技术。我们进行了广泛的分析和消融研究,揭示了几个重要的发现,例如,源代码标记的位置的绝对编码阻碍了摘要的性能,而相对编码显著提高了摘要的性能。我们已经公开了我们的代码,以方便未来的研究。

英文摘要:

Generating a readable summary that describes the functionality of a program is known as source code summarization. In this task, learning code representation by modeling the pairwise relationship between code tokens to capture their long-range dependencies is crucial. To learn code representation for summarization, we explore the Transformer model that uses a self-attention mechanism and has shown to be effective in capturing long-range dependencies. In this work, we show that despite the approach is simple, it outperforms the state-of-the-art techniques by a significant margin. We perform extensive analysis and ablation studies that reveal several important findings, e.g., the absolute encoding of source code tokens' position hinders, while relative encoding significantly improves the summarization performance. We have made our code publicly available to facilitate future research.

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

↑