arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2110.05423cs.CL
收藏

使用文档相似性方法创建代码翻译的并行数据集

Using Document Similarity Methods to create Parallel Datasets for Code Translation

IBM Research AI(IBM研究院人工智能部门);IBM Argentina(IBM阿根廷公司)

Mayank Agarwal, Kartik Talamadupula, Fernando Martinez, Stephanie Houde, Michael Muller, John Richards, Steven I Ross, Justin D. Weisz

摘要:

将源代码从一种程序设计语言转换为另一种语言是对遗留应用程序和代码库进行现代化改造的一项关键而耗时的任务。最近在这个领域的工作已经从软件自然性假设中获得了灵感,通过将自然语言处理技术应用于自动化代码翻译任务。然而,由于在这个领域中的并行数据的缺乏,监督技术只被应用于一组有限的流行程序设计语言。为了绕过这一限制,已经提出了无监督神经机器翻译技术来仅使用单语语料库来学习代码翻译。在这项工作中,我们建议使用文档相似性方法来创建有噪声的并行代码数据集,从而使监督技术能够应用于自动代码翻译,而不必依赖于并行代码数据集的可用性或昂贵的策展。我们探索了在这种自动创建的数据集上训练的模型的噪声容限,并表明这些模型对在合理水平的噪声下训练的模型进行了验证。最后,我们展示了所提出的方法的实际效用,通过创建并行数据集的语言超出了以前的工作中探索的,从而扩大了一套程序设计语言的自动代码翻译。

英文摘要:

Translating source code from one programming language to another is a critical, time-consuming task in modernizing legacy applications and codebases. Recent work in this space has drawn inspiration from the software naturalness hypothesis by applying natural language processing techniques towards automating the code translation task. However, due to the paucity of parallel data in this domain, supervised techniques have only been applied to a limited set of popular programming languages. To bypass this limitation, unsupervised neural machine translation techniques have been proposed to learn code translation using only monolingual corpora. In this work, we propose to use document similarity methods to create noisy parallel datasets of code, thus enabling supervised techniques to be applied for automated code translation without having to rely on the availability or expensive curation of parallel code datasets. We explore the noise tolerance of models trained on such automatically-created datasets and show that these models perform comparably to models trained on ground truth for reasonable levels of noise. Finally, we exhibit the practical utility of the proposed method by creating parallel datasets for languages beyond the ones explored in prior work, thus expanding the set of programming languages for automated code translation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑