APP下载

基于众包知识的API推荐方法研究

2021-08-03张廷秀

电脑知识与技术 2021年17期
关键词:信息检索

张廷秀

摘要:软件开发者在开发过程中使用应用程序接口(Application Programming Interface ,API)来提高软件开发效率,但查找并选取合适的API接口是一项耗时且具有挑战的任务。已有的研究通常采用API文档作为语料库,通过关键词匹配的方式来推荐适合的API,然而由于开发者使用的关键词与需要查找API的差异,因此直接检索的效果并不是很好。众包问答网站如Stack Overflow每天产生数以千计的问答数据,这些数据包含了API名称及API的描述,可以利用这些众包问答数据提升用户检索数据结果。基于这一思路,提出了一种基于信息检索技术和众包问答数据的API推荐方法。该方法利用众包问答数据对用户输入的查询语句进行建模并计算与已有问题的相似度进而根据已有问题的答案为用户推荐相关API。为了验证该方法的有效性,从Stack Overflow中提取Java相关的问答数据,提取其中的API描述信息及API信息进行模拟实验,结果表明,该文方法能有效提高API查询的准确性。

关键词:众包知识;API 推荐;信息检索;问答网站

中图分类号:TP301      文献标识码:A

文章编号:1009-3044(2021)17-0076-03

开放科学(资源服务)标识码(OSID):

Research on API  Recommendation Method Based on Crowdsourcing Knowledge

ZHANG Ting-xiu

(Jiangsu Vocational Institute of Architectural Technology , Xuzhou 221116 , China)

Abstract: Software developers apply application programming interface (API) to improve the efficiency of software development, but it is a time-consuming and challenging task to find the appropriate API. Existing studies usually use API documents as corpus to recommend suitable APIs by keyword matching. However, due to the differences between the keywords used by developers and the APIs they need to find, the effect of direct retrieval is not very good. Crowdsourcing Q & A websites such as stack overflow generate thousands of Q & a data every day. These data include API name and API description, which can be used to improve users' retrieval results. Based on this idea, an API recommendation method based on crowdsourcing Q & a data is proposed. This method uses crowdsourcing Q & a data to model user input query statements and calculate the similarity with existing questions, and then recommends relevant APIs for users according to the answers of existing questions. In order to verify the effectiveness of this method, Java related Q & a data is extracted from stack overflow, and the API description information and API information are extracted for simulation experiments. The results show that this method can effectively improve the accuracy of API query.

Key words:crowdsourced knowledge; API recommendation; information retrieval; Q&A

1 引言

隨着信息技术的发展,软件的规模越来越大,软件开发者需要使用各种各样的开发框架和接口来完成开发任务。然而,当开发者需要开发不熟悉的功能时,他们需要确定哪个API或者库能帮助他们完成开发任务。通常,开发者通过互联网搜索引擎或者软件文档查询、搜索相关API及代码片段来辅助完成开发任务。但从海量的数据或文档中选择合适的API并学习API使用模式是一件耗时且具有挑战性的任务。……

登录APP查看全文

猜你喜欢

信息检索
基于同态加密支持模糊查询的高效隐私信息检索协议
基于信息检索课的大学生信息检索行为调查研究
基于MOOC理念的“翻转课堂”教学改革探索——以海南大学《文献信息检索与利用》课程为例
网络环境下数字图书馆信息检索发展
医学期刊编辑中文献信息检索的应用
在网络环境下高职院校开设信息检索课的必要性研究
基于神经网络的个性化信息检索模型研究
地理信息检索中空间相似性度量的一种模糊方法
教学型大学《信息检索》公选课的设计与实施
论本体论在智能信息检索中的作用