期刊文献+

融合定向自注意机制的代码完成方法 被引量:1

Code Completion Method with Directional Self-attention Mechanism
下载PDF
导出
摘要 智能代码完成是现代智能软件开发中的重要组成部分,但对于动态类型编程语言来说可能具有挑战性.基于学习大型代码库有助于促进动态类型编程语言的代码完成.然而,即使具有注意机制的标准神经语言模型同样丢失了代码的时间顺序信息和代码之间的远程依赖关系.本文使用抽象语法树将源代码转换为单词序列,受到程序源代码结构顺序信息以及定向自注意网络的启发,本文提出使用定向自注意机制来捕捉源代码的时间顺序信息以及代码上下文的远程依赖关系,更好地用于进行代码完成.两个基准数据集上的实验证明了本文的定向自注意机制对代码完成任务的有效性. Intelligent code completion is an important part of modern intelligent software development,but can be challenging for dynamic type programming languages.Learning large code bases helps to facilitate code completion in dynamic type programming languages.However,even a standard neuro-language model with an attention mechanism also loses the chronological information and the remote dependencies between the codes.This paper uses abstract syntax tree to convert source code into a sequence of words.Inspired by the structure order informationofthesource code and directional self-attention network,this paper proposes to use the directed self-attention mechanism to capture the time sequence information and the remote dependencies of the source code,which is better used for code completion.Experiments on two benchmark datasets demonstrate the effectiveness of our directed self-attention mechanism on code completion task.
作者 虞慧群 黄家杰 范贵生 刁旭炀 YU Hui-qun;HUANG Jia-jie;FAN Gui-sheng;DIAO Xu-yang(Department of Computer Scienceand Engineering,East China University of Scienceand Technology,Shanghai 200237,China;Shanghai Key Laboratory of Computer Software Evaluating and Testing,Shanghai 201112,China)
出处 《小型微型计算机系统》 CSCD 北大核心 2020年第5期1078-1083,共6页 Journal of Chinese Computer Systems
基金 国家自然科学基金项目(61702334,61772200)资助 上海市浦江人才计划项目(17PJ1401900)资助 上海市自然科学基金项目(17ZR1406900,17ZR1429700)资助 华东理工大学教育科研基金项目(ZH1726108)资助.
关键词 代码完成 代码依赖 自注意机制 时间顺序信息 抽象语法树 codecompletion remote dependencies directionalself-attention time sequence information of source code abstract syntax tree
  • 相关文献

同被引文献14

引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

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