TY - JOUR
T1 - LSTM-Based with Deterministic Negative Sampling for API Suggestion
AU - Yan, Jinpei
AU - Qi, Yong
AU - Rao, Qifan
AU - He, Hui
AU - Qi, Saiyu
N1 - Publisher Copyright:
© 2019 World Scientific Publishing Company.
PY - 2019/7/1
Y1 - 2019/7/1
N2 - Modern programming relies on a large number of fundamental APIs, but programmers often take great effort to remember names and the usage of APIs when coding, and repeatedly search the related API documents or Q&A websites (e.g. Stack Overflow). To improve the programming efficiency, we present a Java API suggestion model called APIHelper which learns API sequence pattern via the Long Short-Term Memory (LSTM) network, then provides API suggestion based on the program context. Comparing with statistical methods (e.g. Hidden Markov Model (HMM), N-gram), which require establishing one specific model for each class, we propose Deterministic Negative Sampling (DNS) to make API suggestion for a large number of Java classes by one single end-to-end LSTM. To verify this approach, we make API suggestion for 50,000 Java classes and evaluate it with accuracy and top-K accuracy. The results show that APIHelper outperforms other research works both on accuracy and computation efficiency.
AB - Modern programming relies on a large number of fundamental APIs, but programmers often take great effort to remember names and the usage of APIs when coding, and repeatedly search the related API documents or Q&A websites (e.g. Stack Overflow). To improve the programming efficiency, we present a Java API suggestion model called APIHelper which learns API sequence pattern via the Long Short-Term Memory (LSTM) network, then provides API suggestion based on the program context. Comparing with statistical methods (e.g. Hidden Markov Model (HMM), N-gram), which require establishing one specific model for each class, we propose Deterministic Negative Sampling (DNS) to make API suggestion for a large number of Java classes by one single end-to-end LSTM. To verify this approach, we make API suggestion for 50,000 Java classes and evaluate it with accuracy and top-K accuracy. The results show that APIHelper outperforms other research works both on accuracy and computation efficiency.
KW - API suggestion
KW - long short-term memory
KW - negative sampling
KW - neural language model
UR - https://www.scopus.com/pages/publications/85070286524
U2 - 10.1142/S0218194019500347
DO - 10.1142/S0218194019500347
M3 - 文章
AN - SCOPUS:85070286524
SN - 0218-1940
VL - 29
SP - 1029
EP - 1051
JO - International Journal of Software Engineering and Knowledge Engineering
JF - International Journal of Software Engineering and Knowledge Engineering
IS - 7
ER -