TY - GEN
T1 - Automatically Generating API Usage Patterns from Natural Language Queries
AU - Tian, Yanfei
AU - Wang, Xu
AU - Sun, Hailong
AU - Zhao, Yi
AU - Guo, Chunbo
AU - Liu, Xudong
N1 - Publisher Copyright:
© 2018 IEEE.
PY - 2018/7/2
Y1 - 2018/7/2
N2 - Automatically generating code from natural language query is a very promising but much challenging direction. Existing approaches either try to generate the whole code or only predict a small part of critical code elements such as API sequence. Meanwhile, API usage patterns, including APIs and API-related control-flow statements, have the moderate complexity, but can provide enough code framework information and are very helpful for developers to implement various functionalities. Therefore, in this work, we study the problem of generating API usage patterns, represent API usage patterns by one special constrained tree API-MCTree and design one new API-MCTree decoder for automatically transforming natural language queries to API usage patterns, which can leverage both the difference of control-flow statement types and the syntactic knowledge of API usage patterns. We evaluate our model with annotated code snippets in real Java projects collected from GitHub, and the experimental results show that our approach is effective and outperforms the related approaches.
AB - Automatically generating code from natural language query is a very promising but much challenging direction. Existing approaches either try to generate the whole code or only predict a small part of critical code elements such as API sequence. Meanwhile, API usage patterns, including APIs and API-related control-flow statements, have the moderate complexity, but can provide enough code framework information and are very helpful for developers to implement various functionalities. Therefore, in this work, we study the problem of generating API usage patterns, represent API usage patterns by one special constrained tree API-MCTree and design one new API-MCTree decoder for automatically transforming natural language queries to API usage patterns, which can leverage both the difference of control-flow statement types and the syntactic knowledge of API usage patterns. We evaluate our model with annotated code snippets in real Java projects collected from GitHub, and the experimental results show that our approach is effective and outperforms the related approaches.
KW - API
KW - API Usage Pattern
KW - Code Generation
KW - Encoder-Decoder Model
UR - https://www.scopus.com/pages/publications/85066793048
U2 - 10.1109/APSEC.2018.00020
DO - 10.1109/APSEC.2018.00020
M3 - 会议稿件
AN - SCOPUS:85066793048
T3 - Proceedings - Asia-Pacific Software Engineering Conference, APSEC
SP - 59
EP - 68
BT - Proceedings - 25th Asia-Pacific Software Engineering Conference, APSEC 2018
PB - IEEE Computer Society
T2 - 25th Asia-Pacific Software Engineering Conference, APSEC 2018
Y2 - 4 December 2018 through 7 December 2018
ER -