Code Completion with Neural Attention and Pointer Networks
Abstract
Intelligent code completion has become an essential research task to accelerate modern software development. To facilitate effective code completion for dynamically-typed programming languages, we apply neural language models by learning from large codebases, and develop a tailored attention mechanism for code completion. However, standard neural language models even with attention mechanism cannot correctly predict the out-of-vocabulary (OoV) words that restrict the code completion performance. In this paper, inspired by the prevalence of locally repeated terms in program source code, and the recently proposed pointer copy mechanism, we propose a pointer mixture network for better predicting OoV words in code completion. Based on the context, the pointer mixture network learns to either generate a within-vocabulary word through an RNN component, or regenerate an OoV word from local context through a pointer component. Experiments on two benchmarked datasets demonstrate the effectiveness of our attention mechanism and pointer mixture network on the code completion task.
Cite
Text
Li et al. "Code Completion with Neural Attention and Pointer Networks." International Joint Conference on Artificial Intelligence, 2018. doi:10.24963/IJCAI.2018/578Markdown
[Li et al. "Code Completion with Neural Attention and Pointer Networks." International Joint Conference on Artificial Intelligence, 2018.](https://mlanthology.org/ijcai/2018/li2018ijcai-code/) doi:10.24963/IJCAI.2018/578BibTeX
@inproceedings{li2018ijcai-code,
title = {{Code Completion with Neural Attention and Pointer Networks}},
author = {Li, Jian and Wang, Yue and Lyu, Michael R. and King, Irwin},
booktitle = {International Joint Conference on Artificial Intelligence},
year = {2018},
pages = {4159-4165},
doi = {10.24963/IJCAI.2018/578},
url = {https://mlanthology.org/ijcai/2018/li2018ijcai-code/}
}