arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2009.08603cs.SEcs.CL
收藏

利用神经语言模型实现全线代码完成

Towards Full-line Code Completion with Neural Language Models

Peking University(北京大学)

Wenhan Wang, Sijie Shen, Ge Li, Zhi Jin

摘要:

代码完成系统在给出部分完成的代码片段的情况下向开发者建议未来的代码元素。代码完成是集成开发环境(IDE)中最有用的功能之一。目前,大多数代码完成技术一次预测单个令牌。在本文中,我们进一步讨论了直接完成整行代码而不是单个令牌的概率。我们相信,建议更长的代码序列可以进一步提高开发人员的效率。最近,神经语言模型已被采用作为代码完成的首选方法,我们相信这些模型仍然可以应用于整行代码完成一些改进。我们在两个真实世界的Python语料库上进行实验,并基于源代码标记或语法动作评估现有的神经模型。结果表明,神经语言模型可以在我们的任务上取得可接受的结果,具有显著的改进空间。

英文摘要:

A code completion system suggests future code elements to developers given a partially-complete code snippet. Code completion is one of the most useful features in Integrated Development Environments (IDEs). Currently, most code completion techniques predict a single token at a time. In this paper, we take a further step and discuss the probability of directly completing a whole line of code instead of a single token. We believe suggesting longer code sequences can further improve the efficiency of developers. Recently neural language models have been adopted as a preferred approach for code completion, and we believe these models can still be applied to full-line code completion with a few improvements. We conduct our experiments on two real-world python corpora and evaluate existing neural models based on source code tokens or syntactical actions. The results show that neural language models can achieve acceptable results on our tasks, with significant room for improvements.

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

↑