计算机科学
冗余代码
源代码
无法访问的代码
程序设计语言
KPI驱动的代码分析
无效代码
Python(编程语言)
系统代码
代码生成
目标代码
编码(集合论)
恒定重量代码
通用代码
静态程序分析
自然语言处理
算法
软件
软件开发
编码速率
解码方法
线性码
操作系统
集合(抽象数据类型)
区块代码
钥匙(锁)
作者
Yusuke Oda,Hiroyuki Fudaba,Graham Neubig,Hideaki Hata,Sakriani Sakti,Tomoki Toda,Satoshi Nakamura
摘要
Pseudo-code written in natural language can aid the comprehension of source code in unfamiliar programming languages. However, the great majority of source code has no corresponding pseudo-code, because pseudo-code is redundant and laborious to create. If pseudo-code could be generated automatically and instantly from given source code, we could allow for on-demand production of pseudo-code without human effort. In this paper, we propose a method to automatically generate pseudo-code from source code, specifically adopting the statistical machine translation (SMT) framework. SMT, which was originally designed to translate between two natural languages, allows us to automatically learn the relationship between source code/pseudo-code pairs, making it possible to create a pseudo-code generator with less human effort. In experiments, we generated English or Japanese pseudo-code from Python statements using SMT, and find that the generated pseudo-code is largely accurate, and aids code understanding.
科研通智能强力驱动
Strongly Powered by AbleSci AI