arrow
Return

An API recommendation method fusing context and semantic

delete2026-07-01
delete0
PRE
AI
S
Shi Cheng
Z
Zhu, Zihan
S
Shao, Yifei
J
Jinfeng He *
Z
Zelin Wang
DOI:10.1016/j.asej.2026.104354delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
In modern software development, API recommendation systems play a crucial role in enhancing development efficiency. Query-based API recommendation better aligns with developers' actual needs because developers often express programming tasks through natural-language queries and partial code contexts. However, traditional methods relying mainly on keyword matching or static code analysis struggle to jointly capture query semantics and programming context, which may lead to inaccurate or poorly ranked recommendations. To address this problem, we propose the Context-enhanced Query-based API Recommendation Approach (CQARA). CQARA enriches query expressions through synonym substitution, constructs a multidimensional query-contextAPI triplet tensor, applies non-negative tensor factorization to recover latent associations under sparse observations, and uses the BLAST algorithm for local context-sequence matching and API re-ranking. Experiments on real-world datasets show that CQARA consistently improves class-level and method-level API recommendation performance over representative baselines across SuccessRate, Recall, MAP, MRR, and NDCG.
Keywords:
API recommendation
Programming context
Tensor factorization
Context matching
Natural language query

Journal

Ain Shams Engineering Journal cover
Ain Shams Engineering Journal
IF:
5.9
Papers:
3.4K
Citations:
1.2W

Organization

No organization information available
Cited Papers

Cited Papers

No cited papers available