Retrieving API Knowledge from Tutorials and Stack Overflow Based on Natural Language Queries

计算机科学 应用程序编程接口 片段(逻辑) 情报检索 自然语言 知识库 万维网 程序设计语言 自然语言处理
作者
Di Wu,Xiao‐Yuan Jing,Hongyu Zhang,Yang Feng,Haowen Chen,Yuming Zhou,Baowen Xu
出处
期刊:ACM Transactions on Software Engineering and Methodology [Association for Computing Machinery]
卷期号:32 (5): 1-36 被引量:8
标识
DOI:10.1145/3565799
摘要

When encountering unfamiliar APIs, developers tend to seek help from API tutorials and Stack Overflow (SO). API tutorials help developers understand the API knowledge in a general context, while SO often explains the API knowledge in a specific programming task. Thus, tutorials and SO posts together can provide more API knowledge. However, it is non-trivial to retrieve API knowledge from both API tutorials and SO posts based on natural language queries. Two major problems are irrelevant API knowledge in two different resources and the lexical gap between the queries and documents. In this article, we regard a fragment in tutorials and a Question and Answering (Q&A) pair in SO as a knowledge item (KI). We generate ⟨ API, FRA ⟩ pairs (FRA stands for fragment) from tutorial fragments and APIs and build ⟨ API, QA ⟩ pairs based on heuristic rules of SO posts. We fuse ⟨ API, FRA ⟩ pairs and ⟨ API, QA ⟩ pairs to generate API knowledge (AK for short) datasets, where each data item is an ⟨ API, KI ⟩ pair. We propose a novel approach, called PLAN, to automatically retrieve API knowledge from both API tutorials and SO posts based on natural language queries. PLAN contains three main stages: (1) API knowledge modeling, (2) query mapping, and (3) API knowledge retrieving. It first utilizes a deep-transfer-metric-learning-based relevance identification (DTML) model to effectively find relevant ⟨ API, KI ⟩ pairs containing two different knowledge items (⟨ API, QA ⟩ pairs and ⟨ API, FRA ⟩ pairs) simultaneously. Then, PLAN generates several potential APIs as a way to reduce the lexical gap between the query and ⟨ API, KI ⟩ pairs. According to potential APIs, we can select relevant ⟨ API, KI ⟩ pairs to generate potential results. Finally, PLAN returns a list of ranked ⟨ API, KI ⟩ pairs that are related to the query. We evaluate the effectiveness of PLAN with 270 queries on Java and Android AK datasets containing 10,072 ⟨ API, KI ⟩ pairs. Our experimental results show that PLAN is effective and outperforms the state-of-the-art approaches. Our user study further confirms the effectiveness of PLAN in locating useful API knowledge.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
大幅提高文件上传限制,最高150M (2024-4-1)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
OJM完成签到,获得积分10
刚刚
青皛应助李银锋采纳,获得10
刚刚
1秒前
ephore应助孤独树叶采纳,获得100
2秒前
无花果应助Kyu采纳,获得10
2秒前
yuefeng发布了新的文献求助10
2秒前
呆萌的萝发布了新的文献求助10
3秒前
3秒前
3秒前
美丽松鼠完成签到,获得积分10
4秒前
汉堡包应助李会琳采纳,获得10
5秒前
msuyue完成签到,获得积分10
5秒前
6秒前
桐桐应助随缘采纳,获得10
6秒前
依琬应助白翊辰采纳,获得20
6秒前
6秒前
yzy完成签到,获得积分10
7秒前
sxs完成签到 ,获得积分10
7秒前
李银锋完成签到,获得积分20
7秒前
7秒前
今后应助梦与叶落采纳,获得10
8秒前
研友_LOoomL发布了新的文献求助10
10秒前
木木木木完成签到,获得积分10
10秒前
科研通AI2S应助整齐的泽洋采纳,获得10
10秒前
单薄的书琴完成签到,获得积分20
11秒前
英姑应助yuefeng采纳,获得10
11秒前
浩瀚完成签到 ,获得积分10
11秒前
11秒前
LFY完成签到,获得积分10
12秒前
木樨应助寒冷兔子采纳,获得10
13秒前
13秒前
砂浆黏你完成签到,获得积分10
13秒前
于祈完成签到 ,获得积分10
14秒前
15秒前
在水一方应助单薄的书琴采纳,获得10
16秒前
yiling完成签到,获得积分10
16秒前
李爱国应助雪白易烟采纳,获得10
17秒前
整齐的夏波完成签到,获得积分10
18秒前
胖虎发布了新的文献求助10
19秒前
20秒前
高分求助中
Smart but Scattered: The Revolutionary Executive Skills Approach to Helping Kids Reach Their Potential (第二版) 1000
PraxisRatgeber: Mantiden: Faszinierende Lauerjäger 700
The Heath Anthology of American Literature: Early Nineteenth Century 1800 - 1865 Vol. B 500
A new species of Velataspis (Hemiptera Coccoidea Diaspididae) from tea in Assam 500
Machine Learning for Polymer Informatics 500
2024 Medicinal Chemistry Reviews 480
Women in Power in Post-Communist Parliaments 450
热门求助领域 (近24小时)
化学 医学 生物 材料科学 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 基因 遗传学 催化作用 物理化学 免疫学 量子力学 细胞生物学
热门帖子
关注 科研通微信公众号,转发送积分 3222686
求助须知:如何正确求助?哪些是违规求助? 2871470
关于积分的说明 8175592
捐赠科研通 2538390
什么是DOI,文献DOI怎么找? 1370511
科研通“疑难数据库(出版商)”最低求助积分说明 645814
邀请新用户注册赠送积分活动 619677