Summarizing Source Code using a Neural Attention Model
Srinivasan V. Iyer, Ioannis Konstas, Alvin Cheung et al. · Annual Meeting of the Association for Computational Linguistics (ACL) · 2016
High quality source code is often paired with high level summaries of the computation it performs, for example in code documentation or in descriptions posted in online forums.Such summaries are extremely useful for applications such as code search but are expensive to manually author, hence only done for a small fraction of all code that is produced.In this paper, we present the first completely datadriven approach for generating high level summaries of source code.Our model, CODE-NN , uses Long Short Term Memory (LSTM) networks with attention to produce sentences that describe C# code snippets and SQL queries.CODE-NN is trained on a new corpus that is automatically collected from StackOverflow, which we release.Experiments demonstrate strong performance on two tasks: (1) code summarization, where we establish the first end-to-end learning results and outperform strong baselines, and (2) code retrieval, where our learned model improves the state of the art on a recently introduced C# benchmark by a large margin.
Cited by 701 works. doi:10.18653/v1/p16-1195 Open-access PDF
Authors
References
- Long Short-Term Memory
- Dropout: a simple way to prevent neural networks from overfitting
- BLEU
- Efficient Estimation of Word Representations in Vector Space
- Sequence to Sequence Learning with Neural Networks
- Effective Approaches to Attention-based Neural Machine Translation
- Backpropagation through time: what it does and how to do it
- Moses
- Deep visual-semantic alignments for generating image descriptions
- Generating Text with Recurrent Neural Networks