跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 软件工程

arXiv:2012.04188 (cs)
[提交于 2022年4月11日 (v1),最后修订于 2022年4月12日 (此版本, v3)]

标题:Learning to Represent Programs with Heterogeneous Graphs

作者:Kechi Zhang, Wenhan Wang, Huangzhao Zhang, Ge Li, Zhi Jin
查看论文《Learning to Represent Programs with Heterogeneous Graphs》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Program source code contains complex structure information, which can be represented in structured data forms like trees or graphs. To acquire the structural information in source code, most existing researches use abstract syntax trees (AST). A group of works add additional edges to ASTs to convert source code into graphs and use graph neural networks to learn representations for program graphs. Although these works provide additional control or data flow information to ASTs for downstream tasks, they neglect an important aspect of structure information in AST itself: the different types of nodes and edges. In ASTs, different nodes contain different kinds of information like variables or control flow, and the relation between a node and all its children can also be different. To address the information of node and edge types, we bring the idea of heterogeneous graphs to learning on source code and present a new formula of building heterogeneous program graphs from ASTs with additional type information for nodes and edges. We use the ASDL grammar of programming language to define the node and edge types of program graphs. Then we use heterogeneous graph neural networks to learn on these graphs. We evaluate our approach on two tasks: code comment generation and method naming. Both tasks require reasoning on the semantics of complete code snippets. Experiment results show that our approach outperforms baseline models, including homogeneous graph-based models, showing that leveraging the type information of nodes and edges in program graphs can help in learning program semantics.
评论: Accepted by ICPC 2022
主题: 软件工程 (cs.SE); 计算与语言 (cs.CL)
引用方式: arXiv:2012.04188 [cs.SE]
  (或者 arXiv:2012.04188v3 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2012.04188

提交历史

来自:Wenhan Wang
[v2] 2022年4月11日 星期一 11:40:07 UTC
[v3] 2022年4月12日 星期二 01:14:37 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs
< 上一篇   |   下一篇 >
最新 | 近期 | 2022-04
切换浏览方式为:
cs.SE
cs.CL

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站