期刊文献+

融合语法和语义的代码注释生成方法

Code Comments Generation Method Combining Syntax and Semantics
下载PDF
导出
摘要 代码注释生成技术通过分析源代码的语法和语义生成对应的自然语言描述,可以帮助开发人员理解代码,在软件开发和维护过程中起到重要作用.本文提出了一种基于Transformer的代码注释生成方法,可以同时学习源代码的语法结构特征和顺序语义特征.具体而言,将简化的抽象语法树(Abstract Syntax Tree,AST)通过多路树-LSTM建模,捕获树形语法结构编码,在Transformer中融合语法结构信息和顺序语义信息.实验结果表明,本文方法生成的注释质量优于其他基线方法. By analyzing the syntax and semantics of source code,the code comments generation technology can help developers understand the code and play an important role in the process of software development and maintenance.This paper proposes a code comments generation method based on Transformer,which can simultaneously learn the syntactic structure features and sequential semantic features of source code.More specifically,the simplified AST is modeled by Multi-Way Tree-LSTM to capture tree syntax structure encoding,and the syntax structure information and sequential semantic information are combined in Transformer.The experimental results indicate that the code comments quality generated by this method is significantly better than other baseline methods.
作者 王瀚森 王婷 陈铁明 季白杨 WANG Han-sen;WANG Ting;CHEN Tie-ming;JI Bai-yang(Department of Computer Science&Technology,Zhejiang University of Technology,Hangzhou 310023,China)
出处 《小型微型计算机系统》 CSCD 北大核心 2023年第11期2457-2463,共7页 Journal of Chinese Computer Systems
基金 浙江省自然科学基金/重大项目(LD22F020002)资助 浙江省自然科学基金项目(LY20F020027)资助 浙江省重点研发计划项目(2021C01117)资助 2020年工业互联网创新发展工程项目(TC200H01V)资助。
关键词 代码注释生成 抽象语法树 神经机器翻译 TRANSFORMER 编码器-解码器 code comment generation abstract syntax tree neural machine translation Transformer encoder-decoder
  • 相关文献

参考文献1

二级参考文献5

共引文献9

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部