Work

Statistical Machine Translation of English Text to API Code Usages:A comparison of Word Map, Contextual Graph Ordering, Phrase-based, and Neural Network Translations

Year: 2018
Type: dissertation
Abstract: Statistical Machine Translation (SMT) has gained enormous popularity in recent years as natural \nlanguage translations have become increasingly accurate. In this thesis we apply SMT techniques in \nthe context of translating English descriptions of programming tasks to source code. We evaluate \nfour existing approaches: maximum likelihood word maps, ContextualExpansion, phrase-based, and \nneural network translation. As a training and test (i.e. reference translation) data set we clean and \nalign the popular developer discussion forum StackOverflow. \nOur baseline approach, WordMapK, uses a simple maximum likelihood word map model which \nis then ordered using existing code usage graphs. The approach is quite effective, with a precision \nand recall of 20 and 50, respectively. Adding context to the word map model, ContextualExpansion, \nis able to increase the precision to 25 with a recall of 40. The traditional phrase-based translation \nmodel, Moses, achieves a similar precision and recall also incorporating the context of the input text \nby mapping English sequences to code sequences. The final approach is neural network translation, \nOpenNMT. While the median precision is 100 the recall is only 20. When manually examining the \noutput of the neural translation, the code usages are very small and obvious. Our results represent \nan application of existing natural language strategies in the context of software engineering. We \nmake our scripts, corpus, and reference translations in the hope that future work will adapt these \ntechniques to further increase the quality of English to code statistical machine translation.
Language: English
Open Access status: green
OpenAlex ID: W2909062508
Cites: 65
Cited by: 1
Related to: 8