Programming With Unrestricted Natural Language

28732

Authors

nan

Abstract

We argue it is better to program in a natural lan- guage such as English, instead of a programming language like Java. A natural language interface for programming should result in greater readabil- ity, as well as making possible a more intuitive way of writing code. In contrast to previous controlled language systems, we allow unrestricted syntax, us- ing wide-coverage syntactic and semantic methods to extract information from the user’s instructions. We also look at how people actually give pro- gramming instructions in English, collecting and annotating a corpus of such statements. We identify differences between sentences in this corpus and in typical newspaper text, and the effect they have on how we process the natural language input. Finally, we demonstrate a prototype system, that is capable of translating some English instructions into exe- cutable code. 1

Keywords

nan

Full Content

Proceedings of the Australasian Language Technology Workshop 2005, pages 191–199, Sydney, Australia, December 2005. Programming With Unrestricted Natural Language David Vadas and James R. Curran School of Information Technologies University of Sydney NSW 2006, Australia {dvadas1,james}@it.usyd.edu.au Abstract We argue it is better to program in a natural lan- guage such as English, instead of a programming language like Java. A natural language interface for programming should result in greater readabil- ity, as well as making possible a more intuitive way of writing code. In contrast to previous controlled language systems, we allow unrestricted syntax, us- ing wide-coverage syntactic and semantic methods to extract information from the user’s instructions. We also look at how people actually give pro- gramming instructions in English, collecting and annotating a corpus of such statements. We identify differences between sentences in this corpus and in typical newspaper text, and the effect they have on how we process the natural language input. Finally, we demonstrate a prototype system, that is capable of translating some English instructions into exe- cutable code. 1 Introduction Programming is hard. It requires a number of spe- cialised skills and knowledge of the syntax of the particular programming language being used. Pro- grammers need to know a number of different lan- guages, that can vary in control structures, syntax, and standard libraries. In order to reduce these dif- ficulties, we would like to express the steps of the algorithm we are writing in a more natural manner, without being forced into a particular syntax. Ide- ally, we want a plain English description. We have built an initial prototype of such a system, taking unrestricted English as input, and outputting code in the Python programming lan- guage. There are many advantages of such a system. Firstly, any person that can write English, but not a programming language, would still be able to pro- gram. Also, it is often easier to write an English sen- tence describing what is to be done, than to figure out the equivalent code. Many programmers write in a pseudocode style that is almost English before elaborating on the details of an algorithm. There are also many tasks that can easily be described using English sentences, but are much harder to express as code, such as negation and quantification. Another advantage is that code written in English will be much easier to read and understand than in a traditional programming language. Quite often, it is a difficult task to read another programmer’s code. Even understanding one’s own code can be hard af- ter a period of time. This is because without suffi- cient commenting — this is an explanation in plain English — one cannot tell what individual steps are meant to do together. In our system, the comments become the code. Novice programmers could make great use out of such a system. They make simple syntax er- rors because they do not know the language well enough. Similarly, a novice programmer may know what function they want to use, …

Content truncated to 500 words

Labeled Text

We argue it is better to program in a natural language such as English, instead of a programming language like Java. A natural language interface for programming should result in greater readability, as well as making possible a more intuitive way of writing code. In contrast to previous controlled language systems, we allow unrestricted syntax, using wide-coverage syntactic and semantic methods to extract information from the user’s instructions. We also look at how people actually give programming instructions in English, collecting and annotating a corpus of such statements. We identify differences between sentences in this corpus and in typical newspaper text, and the effect they have on how we process the natural language input. Finally, we demonstrate a prototype system, that is capable of translating some English instructions into executable code. 1

Publication Details

Paper ID:
28732
Year:
2005
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan