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.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
扯淡儿完成签到 ,获得积分10
刚刚
XZZ完成签到 ,获得积分10
1秒前
小墨墨完成签到 ,获得积分10
7秒前
李嘻嘻完成签到 ,获得积分10
10秒前
悦耳的城完成签到 ,获得积分10
11秒前
wwwwwl完成签到 ,获得积分10
15秒前
呆呆完成签到 ,获得积分10
20秒前
无心的天真完成签到 ,获得积分10
26秒前
xu完成签到 ,获得积分10
29秒前
31秒前
JBY完成签到 ,获得积分10
31秒前
racill完成签到 ,获得积分10
36秒前
lmm发布了新的文献求助10
37秒前
Eber完成签到,获得积分10
37秒前
喵了个咪完成签到 ,获得积分10
41秒前
海阔天空完成签到 ,获得积分10
41秒前
46秒前
善善完成签到 ,获得积分10
47秒前
舒心糖豆发布了新的文献求助10
52秒前
55秒前
lina完成签到 ,获得积分10
55秒前
LELE完成签到 ,获得积分10
58秒前
wanghao完成签到 ,获得积分10
58秒前
506407完成签到,获得积分10
1分钟前
花生完成签到 ,获得积分10
1分钟前
淡然的芷荷完成签到 ,获得积分10
1分钟前
王佳亮完成签到,获得积分10
1分钟前
忒寒碜完成签到,获得积分10
1分钟前
凌泉完成签到 ,获得积分10
1分钟前
qqaeao完成签到,获得积分10
1分钟前
文献搬运工完成签到 ,获得积分10
1分钟前
shacodow完成签到,获得积分10
1分钟前
ll完成签到,获得积分10
1分钟前
瞿人雄完成签到,获得积分10
1分钟前
Yidie完成签到,获得积分10
1分钟前
没心没肺完成签到,获得积分10
1分钟前
1002SHIB完成签到,获得积分10
1分钟前
zhangguo完成签到 ,获得积分10
1分钟前
nihaolaojiu完成签到,获得积分10
1分钟前
舒心糖豆完成签到 ,获得积分10
1分钟前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Encyclopedia of Reproduction Third Edition 3000
《药学类医疗服务价格项目立项指南(征求意见稿)》 1000
花の香りの秘密―遺伝子情報から機能性まで 800
1st Edition Sports Rehabilitation and Training Multidisciplinary Perspectives By Richard Moss, Adam Gledhill 600
Chemistry and Biochemistry: Research Progress Vol. 7 430
Bone Marrow Immunohistochemistry 400
热门求助领域 (近24小时)
化学 材料科学 生物 医学 工程类 计算机科学 有机化学 物理 生物化学 纳米技术 复合材料 内科学 化学工程 人工智能 催化作用 遗传学 数学 基因 量子力学 物理化学
热门帖子
关注 科研通微信公众号,转发送积分 5628662
求助须知:如何正确求助?哪些是违规求助? 4718076
关于积分的说明 14964721
捐赠科研通 4786551
什么是DOI,文献DOI怎么找? 2555884
邀请新用户注册赠送积分活动 1517038
关于科研通互助平台的介绍 1477738