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

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

计算机科学 > 机器学习

arXiv:1803.04715 (cs)
[提交于 2018年3月13日]

标题:Hierarchical Learning of Cross-Language Mappings through Distributed Vector Representations for Code

作者:Nghi D. Q. Bui, Lingxiao Jiang
查看论文《Hierarchical Learning of Cross-Language Mappings through Distributed Vector Representations for Code》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Translating a program written in one programming language to another can be useful for software development tasks that need functionality implementations in different languages. Although past studies have considered this problem, they may be either specific to the language grammars, or specific to certain kinds of code elements (e.g., tokens, phrases, API uses). This paper proposes a new approach to automatically learn cross-language representations for various kinds of structural code elements that may be used for program translation. Our key idea is two folded: First, we normalize and enrich code token streams with additional structural and semantic information, and train cross-language vector representations for the tokens (a.k.a. shared embeddings based on word2vec, a neural-network-based technique for producing word embeddings; Second, hierarchically from bottom up, we construct shared embeddings for code elements of higher levels of granularity (e.g., expressions, statements, methods) from the embeddings for their constituents, and then build mappings among code elements across languages based on similarities among embeddings. Our preliminary evaluations on about 40,000 Java and C# source files from 9 software projects show that our approach can automatically learn shared embeddings for various code elements in different languages and identify their cross-language mappings with reasonable Mean Average Precision scores. When compared with an existing tool for mapping library API methods, our approach identifies many more mappings accurately. The mapping results and code can be accessed at https://github.com/bdqnghi/hierarchical-programming-language-mapping. We believe that our idea for learning cross-language vector representations with code structural information can be a useful step towards automated program translation.
评论: Accepted at ICSE'18
主题: 机器学习 (cs.LG); 计算与语言 (cs.CL); 软件工程 (cs.SE)
引用方式: arXiv:1803.04715 [cs.LG]
  (或者 arXiv:1803.04715v1 [cs.LG] 对于此版本)
  https://doi.org/10.48550/arXiv.1803.04715
相关 DOI: https://doi.org/10.1145/3183399.3183427

提交历史

来自:Nghi Bui
[v1] 2018年3月13日 星期二 10:30:55 UTC
全文链接:

访问论文:

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

当前浏览上下文:

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

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

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