A Novel Neural Source Code Representation Based on Abstract Syntax Tree

计算机科学 抽象语法树 源代码 人工智能 抽象语法 自然语言处理 程序设计语言 语法 编码(集合论) 语句(逻辑) 自动汇总 人工神经网络 代表(政治) 机器学习 政治 政治学 集合(抽象数据类型) 法学
作者
Jian Zhang,Xu Wang,Hongyu Zhang,Hailong Sun,Kaixuan Wang,Xudong Lü
出处
期刊:International Conference on Software Engineering 被引量:338
标识
DOI:10.1109/icse.2019.00086
摘要

Exploiting machine learning techniques for analyzing programs has attracted much attention. One key problem is how to represent code fragments well for follow-up analysis. Traditional information retrieval based methods often treat programs as natural language texts, which could miss important semantic information of source code. Recently, state-of-the-art studies demonstrate that abstract syntax tree (AST) based neural models can better represent source code. However, the sizes of ASTs are usually large and the existing models are prone to the long-term dependency problem. In this paper, we propose a novel AST-based Neural Network (ASTNN) for source code representation. Unlike existing models that work on entire ASTs, ASTNN splits each large AST into a sequence of small statement trees, and encodes the statement trees to vectors by capturing the lexical and syntactical knowledge of statements. Based on the sequence of statement vectors, a bidirectional RNN model is used to leverage the naturalness of statements and finally produce the vector representation of a code fragment. We have applied our neural network based source code representation method to two common program comprehension tasks: source code classification and code clone detection. Experimental results on the two tasks indicate that our model is superior to state-of-the-art approaches.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
bkagyin应助感动归尘采纳,获得10
刚刚
1秒前
hdbys完成签到,获得积分10
2秒前
宝宝完成签到,获得积分10
2秒前
2秒前
嘞是举仔应助Kenny采纳,获得30
2秒前
orchid发布了新的文献求助10
2秒前
瞌睡虫子完成签到 ,获得积分10
3秒前
chenqinqin发布了新的文献求助10
4秒前
hhhh发布了新的文献求助10
5秒前
5秒前
5秒前
木偶人完成签到,获得积分10
6秒前
7秒前
小小徐发布了新的文献求助10
10秒前
噗噗噗应助大力的图图采纳,获得10
10秒前
11秒前
sun发布了新的文献求助10
11秒前
L2951完成签到 ,获得积分10
13秒前
李Tt完成签到,获得积分10
13秒前
15秒前
今后应助RRR采纳,获得10
15秒前
阿O完成签到,获得积分10
16秒前
16秒前
congcong完成签到,获得积分10
16秒前
16秒前
酷波er应助hhhh采纳,获得10
17秒前
Yussis发布了新的文献求助30
18秒前
sun完成签到,获得积分10
19秒前
LYK2997499077完成签到,获得积分10
20秒前
BruceLiu完成签到,获得积分10
20秒前
W星球Y族人完成签到,获得积分10
20秒前
21秒前
22秒前
王小牛完成签到,获得积分10
22秒前
23秒前
大模型应助断罪残影采纳,获得30
24秒前
BruceLiu发布了新的文献求助10
24秒前
追寻荔枝发布了新的文献求助10
24秒前
27秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
2025-2031全球及中国金刚石触媒粉行业研究及十五五规划分析报告 9000
Encyclopedia of the Human Brain Second Edition 8000
The Cambridge History of China: Volume 4, Sui and T'ang China, 589–906 AD, Part Two 1000
The Composition and Relative Chronology of Dynasties 16 and 17 in Egypt 1000
Translanguaging in Action in English-Medium Classrooms: A Resource Book for Teachers 700
Real World Research, 5th Edition 680
热门求助领域 (近24小时)
化学 材料科学 生物 医学 工程类 计算机科学 有机化学 物理 生物化学 纳米技术 复合材料 内科学 化学工程 人工智能 催化作用 遗传学 数学 基因 量子力学 物理化学
热门帖子
关注 科研通微信公众号,转发送积分 5685075
求助须知:如何正确求助?哪些是违规求助? 5040461
关于积分的说明 15186056
捐赠科研通 4844120
什么是DOI,文献DOI怎么找? 2597144
邀请新用户注册赠送积分活动 1549728
关于科研通互助平台的介绍 1508186