Deep API learning

By Xiaodong Gu, Hongyu Zhang, Dongmei Zhang, Sunghun Kim. 2016

579 citations recorded by the source corpus.

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.

Subfields: Artificial Intelligence, Information Systems

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Graham Neubig
  2. Luke S. Zettlemoyer
  3. Mohit Bansal
  4. Xi Victoria Lin
  5. Hongyu Zhang
  6. Michael Pradel
  7. Percy Liang
  8. Jianfeng Gao

In Information Systems

  1. Michael Pradel
  2. Koushik Sen
  3. Charles Sutton
  4. Hongyu Zhang
  5. Miltiadis Allamanis
  6. Michele Tufano
  7. Ge Li
  8. Denys Poshyvanyk

Citations in the corpus