arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1608.08736cs.SE
收藏

Python中更智能的集体智慧API建议

Collective Intelligence for Smarter API Recommendations in Python

Andrea Renika D'Souza, Di Yang, Cristina V. Lopes

摘要:

软件开发人员在编写程序时广泛使用库和框架的应用程序编程接口(API)。在这种情况下,代码完成弹出窗口中提供的建议可以帮助开发人员选择所需的方法。然而,这些工具推荐的候选人名单往往很大,顺序混乱,有时甚至不完整。最近已经做了大量的工作来提高这些代码完成结果的相关性,特别是对于像Java这样的静态类型语言。然而,这些建议的技术依赖于对象的静态类型,因此不适用于像Python这样的动态类型语言。在本文中,我们提出了PyReco,一个智能的代码完成系统的Python,它使用挖掘的API使用从开源存储库的结果排序的基础上的相关性,而不是传统的字母顺序。为了推荐与工作上下文相关的建议,使用最近邻分类器来识别所有提取的使用模式中的最佳匹配使用。为了评估我们的系统的有效性,代码完成查询自动提取项目和测试定量使用十倍交叉验证技术。评估表明,我们的方法优于顺序的API推荐系统推荐的API标准,以及,第三方库。

英文摘要:

Software developers use Application Programming Interfaces (APIs) of libraries and frameworks extensively while writing programs. In this context, the recommendations provided in code completion pop-ups help developers choose the desired methods. The candidate lists recommended by these tools, however, tend to be large, ordered alphabetically and sometimes even incomplete. A fair amount of work has been done recently to improve the relevance of these code completion results, especially for statically typed languages like Java. However, these proposed techniques rely on the static type of the object and are therefore inapplicable for a dynamically typed language like Python. In this paper, we present PyReco, an intelligent code completion system for Python which uses the mined API usages from open source repositories to order the results based on relevance rather than the conventional alphabetic order. To recommend suggestions that are relevant for a working context, a nearest neighbor classifier is used to identify the best matching usage among all the extracted usage patterns. To evaluate the effectiveness of our system, the code completion queries are automatically extracted from projects and tested quantitatively using a ten-fold cross validation technique. The evaluation shows that our approach outperforms the alphabetically ordered API recommendation systems in recommending APIs for standard, as well as, third-party libraries.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑