Nli2code: Reusing Libraries With Natural Language Interface

Qi Shen,Bing Xie,Yanzhen Zou,Zixiao Zhu,Shijun Wu
DOI: https://doi.org/10.1007/978-3-030-22888-0_12
2019-01-01
Abstract:Modern software development typically involves composing functionality by reusing existing libraries. This task is difficult due to the gap of abstraction levels between user tasks and APIs. In this paper we propose a new concept LibNLI (Library Natural Language Interface) to bridge the gap. LibNLI is a domain-specific language encapsulating APIs into library functions, which is more high-level and instructive than library APIs. In LibNLI, user can reuse libraries with the description of the current programming task. We design an abstract framework NLI2Code to illustrate how to build and use LibNLI.The framework combines three components: functional feature summarizes functionality of a library, code pattern maps each functional feature to its implementation, synthesizer creates local variables to complete code patterns into well-typed snippets. The main goal of NLI2Code is to show feasibility of reusing libraries with natural language interface and lay out the design space to motivate further related research.We have performed a preliminary evaluation by instantiating this framework in a tool NLI4j to reuse Java libraries. The results affirm its capability to summarize accurate functional features and synthesize correct implementation. LibNLI for the evaluated libraries is published.
What problem does this paper attempt to address?