Using Document Similarity Methods to create Parallel Datasets for Code Translation

10/11/2021
by   Mayank Agarwal, et al.
10

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.

READ FULL TEXT

page 10

page 18

research
08/26/2021

AVATAR: A Parallel Corpus for Java-Python Program Translation

Program translation refers to migrating source code from one programming...
research
05/23/2022

Summarize and Generate to Back-translate: Unsupervised Translation of Programming Languages

Back-translation is widely known for its effectiveness for neural machin...
research
10/13/2021

Leveraging Automated Unit Tests for Unsupervised Code Translation

With little to no parallel data available for programming languages, uns...
research
07/07/2017

A parallel corpus of Python functions and documentation strings for automated code documentation and code generation

Automated documentation of programming source code and automated code ge...
research
07/11/2023

Neural Machine Translation Data Generation and Augmentation using ChatGPT

Neural models have revolutionized the field of machine translation, but ...
research
02/08/2023

Syntax and Domain Aware Model for Unsupervised Program Translation

There is growing interest in software migration as the development of so...
research
02/21/2023

On ML-Based Program Translation: Perils and Promises

With the advent of new and advanced programming languages, it becomes im...

Please sign up or login with your details

Forgot password? Click here to reset