Autocompletion of Code from KeywordsDownload PDF

Anonymous

02 Jun 2018 (modified: 05 May 2023)Submitted to NAMPI 2018Readers: Everyone
Abstract: We present a simple approach for synthesizing code from keywords. Our system takes keywords, a subset of tokens from the target code, and generates a line of code. The main challenge is that we only have the output of the system and do not know the real input distribution. We construct simple synthetic distributions by dropping each keyword randomly and based on its frequency, which still generalize to various test distributions. We train a standard sequence-to-sequence model on the synthetic training data and successfully synthesize 71.5% of examples in our manually generated test set. Our approach is simple and language-agnostic and therefore can be easily extended and applied to any programming language.
Keywords: Autocomplete, Program Synthesis
TL;DR: Given "for i 10" as input, our system outputs the code "for i in range(10):".
3 Replies

Loading