Data Augmentation for Code Translation with Comparable Corpora and Multiple References

要約

プログラミング言語間でコードを変換する際の大きな課題の 1 つは、並列トレーニング データが制限されることが多いことです。
この課題を克服するために、我々は 2 つのデータ拡張技術を紹介します。1 つは同等のコーパス (つまり、同様の機能を持つコードペア) を構築するもので、もう 1 つは既存の並列データを複数の参照翻訳で拡張するものです。
具体的には、コード生成モデルを使用して自然言語ドキュメントから生成されたプログラムなど、複数のタイプの比較可能なコーパスを構築および分析します。
さらに、単一の参照翻訳への過剰適合を減らすために、利用可能な並列データに対して追加の翻訳参照を自動的に生成し、単体テストによって翻訳をフィルタリングします。これにより、ターゲット翻訳のバリエーションが増加します。
実験の結果、当社のデータ拡張技術により、Java、Python、C++ 間の変換において CodeT5 が平均 7.5% の計算精度 (CA@1) で大幅に向上し、実行によって変換の正しさが検証されることがわかりました。
コードは https://github.com/Veronicium/CMTrans で入手できます。

要約(オリジナル)

One major challenge of translating code between programming languages is that parallel training data is often limited. To overcome this challenge, we present two data augmentation techniques, one that builds comparable corpora (i.e., code pairs with similar functionality), and another that augments existing parallel data with multiple reference translations. Specifically, we build and analyze multiple types of comparable corpora, including programs generated from natural language documentation using a code generation model. Furthermore, to reduce overfitting to a single reference translation, we automatically generate additional translation references for available parallel data and filter the translations by unit tests, which increases variation in target translations. Experiments show that our data augmentation techniques significantly improve CodeT5 for translation between Java, Python, and C++ by an average of 7.5% Computational Accuracy (CA@1), which verifies the correctness of translations by execution. The code is available at https://github.com/Veronicium/CMTrans.

arxiv情報

著者 Yiqing Xie,Atharva Naik,Daniel Fried,Carolyn Rose
発行日 2023-11-01 06:01:22+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.LG, cs.SE パーマリンク