检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:许柏炎 蔡瑞初[1] 梁智豪 XU Boyan;CAI Ruichu;LIANG Zhihao(School of Computers,Guangdong University of Technology,Guangzhou 510006,China)
出 处:《计算机工程》2021年第4期92-99,共8页Computer Engineering
基 金:国家自然科学基金(61876043);广东省自然科学基金(2014A030306004,2014A030308008);广东特支计划(2015TQ01X140);NSFC-广东联合基金(U1501254);广州市珠江科技新星专项(201610010101);广州市科技计划项目(201902010058)。
摘 要:现有代码注释生成方法的复制机制未考虑源代码复杂多变的语法结构,导致存在准确率和鲁棒性不高等问题。通过改进指针网络使其支持结构化数据输入,提出一种语法辅助复制机制,以用于代码注释自动生成。该机制包含节点筛选策略和去冗余生成策略2个部分。节点筛选策略基于语法信息引入掩盖变量以过滤无效节点,从而降低指针网络对复杂语法的学习成本。去冗余生成策略基于时间窗口对节点概率进行动态调整,可解决代码自动注释中关键信息缺失的问题。实验结果表明,在WikiSQL数据集上,相比基准方法,该机制的BLEU、ROUGE-2和ROUGE-L指标值分别提升14.5%、10.3%和5.5%,在ATIS数据集上,上述指标值分别提升2.8%、6.6%和2.5%,验证了该机制的有效性以及引入语法信息的必要性。The copy mechanisms of the existing code comment generation methods do not consider the complex and varying grammar structures of source code,resulting in low copy accuracy and low robustness.This paper reconstructs the pointer network to make it support structured data input,and proposes a new grammar-aided copy mechanism for automatic comment generation.The mechanism consists of two parts:node filtering strategy and de-redundant generation strategy.Node filtering strategy that introduces masking variables to filter invalid type nodes based on grammatical information,which reduces the learning cost of complex grammar in pointer networks.De-redundant generation strategy that dynamically adjusts the node probability based on the time window,which solves the problem of missing key information in the automatically generated comment.Experimental results show that compared with baseline methods,the proposed method improves BLEU by 14.5%,ROUGE-2 by 10.3%and ROUGE-L by 5.5%on the WikiSQL dataset,and improves BLEU by 2.8%,ROUGE-2 by 6.6%and ROUGE-L by 2.5%on the ATIS dataset.The results verify the effectiveness of the mechanism and the necessity of introducing grammatical information.
关 键 词:代码注释生成 指针网络 自然语言生成 结构信息 复制机制
分 类 号:TP312[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.117