Source code processing heavily relies on the methods widely used in natural language processing (NLP), but involves specifics that need to be taken into account to achieve higher quality. An example of this specificity is that the semantics of a variable is defined not only by its name but also by the contexts in which the variable occurs. In this work, we develop dynamic embeddings, a recurrent mechanism that adjusts the learned semantics of the variable when it obtains more information about the variable's role in the program. We show that using the proposed dynamic embeddings significantly improves the performance of the recurrent neural network, in code completion and bug fixing tasks.
翻译:源码处理在很大程度上依赖于自然语言处理(NLP)中广泛使用的方法,但涉及为实现更高质量而需要考虑的具体细节。这种特殊性的一个例子是,变量的语义不仅以其名称来定义,而且还以变量发生的背景来定义。在这项工作中,我们开发动态嵌入器,这是一个经常性机制,在变量获得更多关于变量在程序中的作用的信息时调整该变量所学的语义。我们表明,使用拟议的动态嵌入器可大大改善经常神经网络在代码完成和错误修正任务方面的性能。