PTM-APIRec: Leveraging Pre-trained Models of Source Code in API Recommendation

Author:

Li Zhihao1,Li Chuanyi1,Tang Ze1,Huang Wanhong1,Ge Jidong1,Luo Bin1,Ng Vincent2,Wang Ting3,Hu Yucheng3,Zhang Xiaopeng3

Affiliation:

1. State Key Laboratory for Novel Software Technology at Nanjing University, China

2. University of Texas at Dallas, USA

3. Tencent, China

Abstract

Recommending APIs is a practical and essential feature of IDEs. Improving the accuracy of API recommendations is an effective way to improve coding efficiency. With the success of deep learning in software engineering, the state-of-the-art (SOTA) performance of API recommendation is also achieved by deep learning-based approaches. However, existing SOTAs either only consider the API sequences in the code snippets, or rely on complex operations for extracting hand-crafted features, all of which have potential risks in under-encoding the input code snippets and further resulting in sub-optimal recommendation performance. To this end, this paper proposes to utilize the code understanding ability of existing general code P re- T raining M odels to fully encode the input code snippet to improve the accuracy of API Rec ommendation, namely, PTM-APIRec . To ensure that the code semantics of the input are fully understood and the API recommended actually exists, we use separate vocabularies for the input code snippet and the APIs to be predicted. The experimental results on the JDK and Android datasets show that PTM-APIRec surpasses existing approaches. Besides, an effective way to improve the performance of PTM-APIRec is to enhance the pre-trained model with more pre-training data (which is easier to obtain than API recommendation datasets).

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference54 articles.

1. Unified Pre-training for Program Understanding and Generation

2. PARC: Recommending API methods parameters

3. Learning from examples to improve code completion systems

4. Chi Chen , Xin Peng , Bihuan Chen , Jun Sun , Zhenchang Xing , Xin Wang , and Wenyun Zhao . 2022 . ”More Than Deep Learning”: post-processing for API sequence recommendation. Empir. Softw. Eng. 27 , 1 (2022), 15 . https://doi.org/10.1007/s10664-021-10040-2 10.1007/s10664-021-10040-2 Chi Chen, Xin Peng, Bihuan Chen, Jun Sun, Zhenchang Xing, Xin Wang, and Wenyun Zhao. 2022. ”More Than Deep Learning”: post-processing for API sequence recommendation. Empir. Softw. Eng. 27, 1 (2022), 15. https://doi.org/10.1007/s10664-021-10040-2

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3