Translating Natural Language to Code: An Unsupervised Ontology-Based Approach

Mattia Atzeni, Maurizio Atzori · 2018

In this paper, we describe a semantic approach to translate complex natural language commands and questions into an appropriate object-oriented source code. To address this task, we leverage the Semantic Web technology stack to developCodeOntology, an open community-shared resource aimed at making open source code a first-class citizen of the Web, where it can be interlinked with other resources, enabling interesting search and analyses that are nowadays impossible. Hence, we propose an unsupervised algorithm which relies on CodeOntology for querying source code to retrieve a set of methods and code snippets that are ranked and combined to translate a natural language specification into a Java source code. Experimental results show that our approach is comparable with other state-of-the-art proprietary systems, such as the WolframAlpha computational knowledge engine.

Read the paper · More papers on PaperTik