API recommendation method based on natural nearest neighbors and collaborative filtering

被引:0
|
作者
Zheng H.-H. [1 ]
Huang Z.-Q. [1 ]
Li W.-W. [1 ]
Yu Y.-S. [1 ]
Wang Y.-C. [1 ]
机构
[1] College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing
来源
Zhejiang Daxue Xuebao (Gongxue Ban)/Journal of Zhejiang University (Engineering Science) | 2022年 / 56卷 / 03期
关键词
API recommendation; BM25; Code reuse; Collaborative filtering; Natural nearest neighbors;
D O I
10.3785/j.issn.1008-973X.2022.03.008
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
An API recommendation method based on natural nearest neighbors and collaborative filtering named N-APIRec was proposed in order to solve the problem of recommendation performance degradation caused by improper neighbor selection. In this model, BM25 algorithm was used to transform the projects into vectors. Then the natural neighbor algorithm was used to filter the similar projects in the dataset to reduce the search scope, and the similar method declarations were filtered from the similar projects. Finally, the APIs were recommended through collaborative filtering. N-APIRec was compared with the state-of-the-art approach on MV and SH data sets. The results were verified the effectiveness of N-APIRec, the success rate of MV and SH data sets recommendation was 77.38%and 30.00% respectively, which was better than the existing methods. Copyright ©2022 Journal of Zhejiang University (Engineering Science). All rights reserved.
引用
收藏
页码:494 / 502
页数:8
相关论文
共 26 条
  • [1] NIE L, JIANG H, REN Z, Et al., Query expansion based on crowd knowledge for code search, IEEE Transactions on Services Computing, 9, 5, pp. 771-783, (2016)
  • [2] JIANG H, NIE L, SUN Z, Et al., ROSF: leveraging information retrieval and supervised learning for recommending code snippets, IEEE Transactions on Services Computing, 12, 1, pp. 34-46, (2019)
  • [3] RAGHOTHAMAN M, WEI Y, HAMADI Y., SWIM: synthesizing what I mean-code search and idiomatic snippet synthesis, Proceedings of the 38th International Conference on Software Engineering, pp. 357-367, (2016)
  • [4] GU X, ZHANG H, ZHANG D, Et al., Deep API learning, Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 631-642, (2016)
  • [5] CAI L, WANG H, HUANG Q, Et al., BIKER: a tool for Bi-information source based API method recommendation, Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 1075-1079, (2019)
  • [6] ZHOU Y, YANG X, CHEN T, Et al., Boosting API recommendation with implicit feedback, IEEE Transactions on Software Engineering, 1, 1, (2021)
  • [7] XIE W, PENG X, LIU M, Et al., API method recommendation via explicit matching of functionality verb phrases, Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 1015-1026, (2020)
  • [8] LECUN Y, YOSHUA B., Convolutional networks for images, speech, and time series, The Handbook of Brain Theory and Neural Networks, 3361, 10, (1995)
  • [9] HOCHREITER S, SCHMIDHUBER J., Long short-term memory, Neural computation, 9, 8, pp. 1735-1780, (1997)
  • [10] SCARSELLI F, GORI M, TSOI A, Et al., The graph neural network model, IEEE Transactions on Neural Networks, 20, 1, pp. 61-80, (2008)