Code Generation for Unknown Libraries via Reading API Documentations

02/16/2022
by   Koki Washio, et al.
0

Open-domain code generation is a challenging problem because the set of functions and classes that we use are frequently changed and extended in programming communities. We consider the challenge of code generation for unknown libraries without additional training. In this paper, we explore a framework of code generation that can refer to relevant API documentations like human programmers to handle unknown libraries. As a first step of this direction, we implement a model that can extract relevant code signatures from API documentations based on a natural language intent and copy primitives from the extracted signatures. Moreover, to evaluate code generation for unknown libraries and our framework, we extend an existing dataset of open-domain code generation and resplit it so that the evaluation data consist of only examples using the libraries that do not appear in the training data. Experiments on our new split show that baseline encoder-decoder models cannot generate code using primitives of unknown libraries as expected. In contrast, our model outperforms the baseline on the new split and can properly generate unknown primitives when extracted code signatures are noiseless.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/13/2022

DocCoder: Generating Code by Retrieving and Reading Docs

Natural-language-to-code models learn to generate a code snippet given a...
research
10/05/2019

JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code Generation

Interactive programming with interleaved code snippet cells and natural ...
research
11/11/2020

Documentation Generation as Information Visualization

Automatic documentation generation tools, or auto docs, are widely used ...
research
12/12/2018

CAMLroot: revisiting the OCaml FFI

The OCaml language comes with a facility for interfacing with C code -- ...
research
05/06/2023

ToolCoder: Teach Code Generation Models to use API search tools

Automatically generating source code from natural language descriptions ...
research
12/20/2022

Execution-Based Evaluation for Open-Domain Code Generation

To extend the scope of coding queries to more realistic settings, we pro...
research
12/23/2022

Neural Transition-based Parsing of Library Deprecations

This paper tackles the challenging problem of automating code updates to...

Please sign up or login with your details

Forgot password? Click here to reset