Context based API recommendation is an important way to help developers find the needed APIs effectively and efficiently. For effective API recommendation, we need not only a joint view of both structural and textual code information, but also a holistic view of correlated API usage in control and data flow graph as a whole. Unfortunately, existing API recommendation methods exploit structural or textual code information separately. In this work, we propose a novel API recommendation approach called APIRec-CST (API Recommendation by Combining Structural and Textual code information). APIRec-CST is a deep learning model that combines the API usage with the text information in the source code based on an API Context Graph Network and a Code Token Network that simultaneously learn structural and textual features for API recommendation. We apply APIRec-CST to train a model for JDK library based on 1,914 open-source Java projects and evaluate the accuracy and MRR (Mean Reciprocal Rank) of API recommendation with another 6 open-source projects. The results show that our approach achieves respectively a top-1, top-5, top-10 accuracy and MRR of 60.3%, 81.5%, 87.7% and 69.4%, and significantly outperforms an existing graph-based statistical approach and a tree-based deep learning approach for API recommendation. A further analysis shows that textual code information makes sense and improves the accuracy and MRR. We also conduct a user study in which two groups of students are asked to finish 6 programming tasks with or without our APIRec-CST plugin. The results show that APIRec-CST can help the students to finish the tasks faster and more accurately and the feedback on the usability is overwhelmingly positive.


翻译:基于背景的 API 建议是帮助开发者有效和高效地找到所需的 API 的重要方法。 为了有效 API 推荐, 我们不仅需要共同查看结构和文本代码信息, 还需要整体查看整个控制和数据流图中相关的 API 使用。 不幸的是, 现有的 API 推荐方法分别利用结构或文本代码信息。 在这项工作中, 我们提出一个新的 API 推荐方法, 称为 API 参考建议, 将结构和文本代码信息合并为 API 。 API 是一个深层次学习模式, 将 API 的用法与源代码中的文本信息结合起来, 基于 API 的 结构与文本代码信息, 以及基于 API 的源码信息信息信息信息, 以及基于 API 的源码和MRRR 代码, 我们采用的方法可以分别实现头1级、前5级、上级和MRRU的文本信息, 以60.3%的源码为基础完成 A.

0
下载
关闭预览

相关内容

《计算机信息》杂志发表高质量的论文,扩大了运筹学和计算的范围,寻求有关理论、方法、实验、系统和应用方面的原创研究论文、新颖的调查和教程论文,以及描述新的和有用的软件工具的论文。官网链接:https://pubsonline.informs.org/journal/ijoc
专知会员服务
44+阅读 · 2020年10月31日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
145+阅读 · 2019年10月12日
LibRec 精选:从0开始构建RNN网络
LibRec智能推荐
5+阅读 · 2019年5月31日
LibRec 精选:近期15篇推荐系统论文
LibRec智能推荐
5+阅读 · 2019年3月5日
LibRec 精选:推荐系统的常用数据集
LibRec智能推荐
17+阅读 · 2019年2月15日
LibRec 精选:推荐系统的论文与源码
LibRec智能推荐
14+阅读 · 2018年11月29日
LibRec 精选:连通知识图谱与推荐系统
LibRec智能推荐
3+阅读 · 2018年8月9日
人工智能 | 国际会议截稿信息9条
Call4Papers
4+阅读 · 2018年3月13日
LibRec 精选:推荐系统9个必备数据集
LibRec智能推荐
6+阅读 · 2018年3月7日
LibRec 每周精选:近期推荐系统论文及进展
LibRec智能推荐
30+阅读 · 2018年2月5日
人工智能 | 国际会议截稿信息5条
Call4Papers
6+阅读 · 2017年11月22日
【论文】图上的表示学习综述
机器学习研究会
12+阅读 · 2017年9月24日
Arxiv
20+阅读 · 2019年11月23日
Arxiv
3+阅读 · 2019年3月1日
Arxiv
23+阅读 · 2018年8月3日
VIP会员
相关VIP内容
专知会员服务
44+阅读 · 2020年10月31日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
145+阅读 · 2019年10月12日
相关资讯
LibRec 精选:从0开始构建RNN网络
LibRec智能推荐
5+阅读 · 2019年5月31日
LibRec 精选:近期15篇推荐系统论文
LibRec智能推荐
5+阅读 · 2019年3月5日
LibRec 精选:推荐系统的常用数据集
LibRec智能推荐
17+阅读 · 2019年2月15日
LibRec 精选:推荐系统的论文与源码
LibRec智能推荐
14+阅读 · 2018年11月29日
LibRec 精选:连通知识图谱与推荐系统
LibRec智能推荐
3+阅读 · 2018年8月9日
人工智能 | 国际会议截稿信息9条
Call4Papers
4+阅读 · 2018年3月13日
LibRec 精选:推荐系统9个必备数据集
LibRec智能推荐
6+阅读 · 2018年3月7日
LibRec 每周精选:近期推荐系统论文及进展
LibRec智能推荐
30+阅读 · 2018年2月5日
人工智能 | 国际会议截稿信息5条
Call4Papers
6+阅读 · 2017年11月22日
【论文】图上的表示学习综述
机器学习研究会
12+阅读 · 2017年9月24日
Top
微信扫码咨询专知VIP会员