arrow
返回

CRAM: Code Recommendation With Programming Context Based on Self-Attention Mechanism

delete2023-03-01
delete4
PRE
AI
陶
陶传奇 (Chuanqi Tao) *
K
Kai Lin
黄
黄志球 (Zhiqiu Huang)
X
Xiaobing Sun
DOI:10.1109/TR.2022.3171309delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code recommendation with programming context is to use the contextual code surrounding the missing code to automatically find that which of the code snippets would be useful to assist in the completion of the program. In this way, the developers need not take time to formulate explicit queries or write descriptions. Existing work only treats code as textual documents and use information retrieval techniques to retrieve relevant code snippets, which is difficult to capture the semantics of code adequately. The self-attention mechanism have achieved promising progress in various natural language processing tasks, especially for extracting deep semantic information from long sequences. Inspired from this, we propose a novel code recommendation with programming context based on self-attention mechanism (CRAM). The proposed approach first builds a small-scale candidate set from codebase. Then, it utilizes self-attention networks in the abstract syntax tree to capture the deep semantics of code, and finally recommend the relevant code to developers. We conduct several experiments to evaluate our approach in a large-scale codebase containing 741 148 code snippets. The experimental results show that CRAM can effectively recommend code and outperforms related work in recall, precision, and NDCG.
Keyword:
Codes
Programming
Semantics
Task analysis
Natural languages
Symbols
Java
Abstract syntax tree (AST)
code recommendation
programming context
self-attention mechanism
structural information

期刊

IEEE Transactions on Reliability 封面图
IEEE Transactions on Reliability
IF:
5.7
论文数:
2.8K
被引数:
8.5K

机构

Y
Yangzhou University
学者数:
2.8W
论文数: 1.9W
被引数: 3.3W
引用论文

引用论文

No Perisaccadic Mislocalization with Abruptly Cancelled Saccades
err2014-04-16
err0
errOAAI
errJeroen Atsma; Femke Maij; Brian D. Corneil; W. Pieter Medendorp
err分享
err收藏
err分享
err收藏
err
IF0
err
err0
PREAI
err
err分享
err收藏
Comparison of sub‐ versus suprafascially raised anterolateral thigh free flaps with regard to donor‐site morbidity, function and aesthetics
err2017-11-20
err0
PREAI
errSebastian Fischer; Yannick Diehm; Christoph Hirche; Thomas Kremer; Adrien Daigeler; Ulrich Kneser; J. Frederick Hernekamp
err分享
err收藏
ROSF: Leveraging Information Retrieval and Supervised Learning for Recommending Code Snippets
err2019-01-01
err54
errOAAI
errJiang, He; Nie, Liming; Sun, Zeyi; Ren, Zhilei; Kong, Weiqiang; Zhang, Tao; Luo, Xiapu
err分享
err收藏
学者 查看更多内容