Mapping Language to Code in Programmatic Context

Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Luke Zettlemoyer


Abstract
Source code is rarely written in isolation. It depends significantly on the programmatic context, such as the class that the code would reside in. To study this phenomenon, we introduce the task of generating class member functions given English documentation and the programmatic context provided by the rest of the class. This task is challenging because the desired code can vary greatly depending on the functionality the class provides (e.g., a sort function may or may not be available when we are asked to “return the smallest element” in a particular member variable list). We introduce CONCODE, a new large dataset with over 100,000 examples consisting of Java classes from online code repositories, and develop a new encoder-decoder architecture that models the interaction between the method documentation and the class environment. We also present a detailed error analysis suggesting that there is significant room for future work on this task.
Anthology ID:
D18-1192
Volume:
Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing
Month:
October-November
Year:
2018
Address:
Brussels, Belgium
Editors:
Ellen Riloff, David Chiang, Julia Hockenmaier, Jun’ichi Tsujii
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
1643–1652
Language:
URL:
https://aclanthology.org/D18-1192
DOI:
10.18653/v1/D18-1192
Bibkey:
Cite (ACL):
Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, and Luke Zettlemoyer. 2018. Mapping Language to Code in Programmatic Context. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1643–1652, Brussels, Belgium. Association for Computational Linguistics.
Cite (Informal):
Mapping Language to Code in Programmatic Context (Iyer et al., EMNLP 2018)
Copy Citation:
PDF:
https://aclanthology.org/D18-1192.pdf
Code
 sriniiyer/concode
Data
CONCODEHearthstone