Context-aware API recommendation using tensor factorization

Science China Information Sciences(2023)

引用 0|浏览16
暂无评分
摘要
An activity constantly engaged by most programmers in coding is to search for appropriate application programming interfaces (APIs). Contextual information is widely recognized to play a crucial role in effective API recommendation, but it is largely overlooked in practice. In this paper, we propose context-aware API recommendation using tensor factorization (CARTF), a novel API recommendation approach in considering programmers’ working context. To this end, we use tensors to explicitly represent the query-API-context triadic relation. When a new query is made, CARTF harnesses word embeddings to retrieve similar user queries, based on which a third-order tensor is constructed. CARTF then applies non-negative tensor factorization to complete missing values in the tensor and the Smith-Waterman algorithm to identify the most matched context. Finally, the ranking of the candidate APIs can be derived based on which API sequences are recommended. Our evaluation confirms the effectiveness of CARTF for class-level and method-level API recommendations, outperforming state-of-the-art baseline approaches against a number of performance metrics, including SuccessRate, Precision, and Recall.
更多
查看译文
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要