Deep API learning
Xiaodong Gu, Hongyu Zhang, Dongmei Zhang et al. · ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE) · 2016
Developers often wonder how to implement a certain functionality (e.g., how to parse XML files) using APIs. Obtaining an API usage sequence based on an API-related natural language query is very helpful in this regard. Given a query, existing approaches utilize information retrieval models to search for matching API sequences. These approaches treat queries and APIs as bags-of-words and lack a deep understanding of the semantics of the query. We propose DeepAPI, a deep learning based approach to generate API usage sequences for a given natural language query. Instead of a bag-of-words assumption, it learns the sequence of words in a query and the sequence of associated APIs. DeepAPI adapts a neural language model named RNN Encoder-Decoder. It encodes a word sequence (user query) into a fixed-length context vector, and generates an API sequence based on the context vector. We also augment the RNN Encoder-Decoder by considering the importance of individual APIs. We empirically evaluate our approach with more than 7 million annotated code snippets collected from GitHub. The results show that our approach generates largely accurate API sequences and outperforms the related approaches.
Cited by 485 works. doi:10.1145/2950290.2950334
Authors
References
- BLEU
- Sequence to Sequence Learning with Neural Networks
- Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation
- Neural Machine Translation by Jointly Learning to Align and Translate
- The mathematics of statistical machine translation: parameter estimation
- ADADELTA: An Adaptive Learning Rate Method
- Class-based n -gram models of natural language
- Recurrent neural network based language model
- Large-Scale Machine Learning with Stochastic Gradient Descent
- Advances in Neural Information Processing Systems 27 (NIPS 2014)