Deep API Learning

05/27/2016
by   Xiaodong Gu, et al.
0

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 bag-of-words (i.e., keyword matching or word-to-word alignment) 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 bags-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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/03/2022

Deep API Learning Revisited

Understanding the correct API usage sequences is one of the most importa...
research
10/23/2018

Bridging Semantic Gaps between Natural Languages and APIs with Word Embedding

Developers increasingly rely on text matching tools to analyze the relat...
research
03/29/2021

Embedding API Dependency Graph for Neural Code Generation

The problem of code generation from textual program descriptions has lon...
research
03/22/2023

PICASO: Enhancing API Recommendations with Relevant Stack Overflow Posts

While having options could be liberating, too many options could lead to...
research
10/27/2020

Dynamic Boundary Time Warping for Sub-sequence Matching with Few Examples

The paper presents a novel method of finding a fragment in a long tempor...
research
12/23/2021

Revisiting, Benchmarking and Exploring API Recommendation: How Far Are We?

Application Programming Interfaces (APIs), which encapsulate the impleme...
research
07/02/2019

Learning to Reformulate the Queries on the WEB

Inability of the naive users to formulate appropriate queries is a funda...

Please sign up or login with your details

Forgot password? Click here to reset