- Title
- Deep API learning
- Creator
- Gu, Xiaodong; Zhang, Hongyu; Zhang, Dongmei; Kim, Sunghun
- Relation
- 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2016). FSE 2016 Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (Seattle, WA 13-18 November, 2016) p. 631-642
- Publisher Link
- http://dx.doi.org/10.1145/2950290.2950334
- Publisher
- Association for Computing Machinery (ACM)
- Resource Type
- conference paper
- Date
- 2016
- Description
- 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.
- Subject
- API; deep learning; RNN; API usage; code search
- Identifier
- http://hdl.handle.net/1959.13/1357334
- Identifier
- uon:31906
- Identifier
- ISBN:9781450342186
- Language
- eng
- Reviewed
- Hits: 1352
- Visitors: 1549
- Downloads: 0
Thumbnail | File | Description | Size | Format |
---|