Why not Just Look for Answers? Using a More Direct Way for API Recommendation

Automated API recommendation technology can help developers quickly find target APIs that meet their require-ments. Some retrieval-based API recommendation approaches, such as BIKER and CLEAR, adopt an indirect API recommen-dation strategy. Although these approaches have shown good performance, we observed two limitations in these approaches: (1) These approaches heavily relies on the coverage of the collected question titles proposed by developers; (2) These approaches ignore the API source code information. To overcome the two limitations, we propose an approach named AnsAPIRec (Answer- directed API Recommendation), which leverages a pre-trained model and joint-attention mechanism in this paper. In addition to the fully qualified name of the API, AnsAPIRec extracts the corresponding source code from the JDK as an additional feature. AnsAPIRec adopts a direct API recommendation strategy, which directly calculates the similarity between user queries and API features, i.e., API fully qualified name and API source code, to find the target API, alleviating the reliance on question titles. To further enhance AnsAPIRec's ability to understand the semantics of the inputs, we propose a joint-attention mechanism to learn the interdependent representations between the queries and API features. This deep semantic fusion mechanism enables AnsAPIRec to perform well in understanding user intent and API functionality. We reused the APIBench-Q dataset, containing 5885 queries for training and 653 queries for testing. The experimental result shows that AnsAPIRec achieved an MRR of 0.473, significantly outperforming the baseline approaches, BIKER and CLEAR.

Authors

Institutions

Publication Details

Published
2024-12-03
DOI
https://doi.org/10.1109/apsec65559.2024.00048
Primary Topic
Web Data Mining and Analysis
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Why not Just Look for Answers? Using a More Direct Way for API Recommendation

Wei Mu, Changxin Liu, Ling Xu, Rui Qin
Web Data Mining and Analysis
article

Why not Just Look for Answers? Using a More Direct Way for API Recommendation

Wei Mu, Changxin Liu, Ling Xu, Rui Qin
article en

Abstract

Automated API recommendation technology can help developers quickly find target APIs that meet their require-ments. Some retrieval-based API recommendation approaches, such as BIKER and CLEAR, adopt an indirect API recommen-dation strategy. Although these approaches have shown good performance, we observed two limitations in these approaches: (1) These approaches heavily relies on the coverage of the collected question titles proposed by developers; (2) These approaches ignore the API source code information. To overcome the two limitations, we propose an approach named AnsAPIRec (Answer- directed API Recommendation), which leverages a pre-trained model and joint-attention mechanism in this paper. In addition to the fully qualified name of the API, AnsAPIRec extracts the corresponding source code from the JDK as an additional feature. AnsAPIRec adopts a direct API recommendation strategy, which directly calculates the similarity between user queries and API features, i.e., API fully qualified name and API source code, to find the target API, alleviating the reliance on question titles. To further enhance AnsAPIRec's ability to understand the semantics of the inputs, we propose a joint-attention mechanism to learn the interdependent representations between the queries and API features. This deep semantic fusion mechanism enables AnsAPIRec to perform well in understanding user intent and API functionality. We reused the APIBench-Q dataset, containing 5885 queries for training and 653 queries for testing. The experimental result shows that AnsAPIRec achieved an MRR of 0.473, significantly outperforming the baseline approaches, BIKER and CLEAR.

Ministry of Education of the People's Republic of China (CN)
Openalex Percentile: Top 52%
Web Data Mining and Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.