Using machine translation for converting Python 2 to Python 3 code
Open accessAbstract
In this paper, we have tried to use statistical machine translation in order to convert Python 2 code to Python 3 code. We use data from two projects and achieve a high BLEU score. We also investigate the cross-project training and testing to analyze the errors so as to ascertain differences with previous case. We have described a pilot study on modeling programming languages as natural language to build translation models on the lines of natural languages. This can be further worked on to translate between versions of a programming language or cross-programming-languages code translation.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Code translation facilitates refactoring outdated languages, transitions to faster languages, and supports programming language migration.
“It facilitates the refactoring of code written in outdated languages [10], transitions from simpler but slower languages to more complex and faster ones [11], and supports programming language migration in software development [12]-[19].”
From RepoTransBench: A Real-World Multilingual Benchmark for Repository-Level Code Translation (2026) · cites this paper as [10]
Cited by
Sorted by citations
A Survey of Machine Learning for Big Code and Naturalness
Allamanis, M., Barr, E. T., Devanbu, P., & Sutton, C. (2019) · ACM Computing Surveys · doi:10.1145/3212695 · Cited by 150 · see citing works
Leveraging automated unit tests for unsupervised code translation
Roziere, B., Zhang, J. M., Charton, F., Harman, M., Synnaeve, G., & Lample, G. (2021) · arXiv · doi:10.48550/arxiv.2110.06773 · Cited by 39 · see citing works
RepoTransBench: A Real-World Multilingual Benchmark for Repository-Level Code Translation
Wang, Y., Wang, Y., Wang, S., Guo, D., Chen, J., Grundy, J., Liu, X., Ma, Y., Mao, M., Zhang, H., et al. (2026) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2025.3645056 · Cited by 12 · see citing works
“It facilitates the refactoring of code written in outdated languages [10], transitions from simpler but slower languages to more complex and faster ones [11], and supports programming language migration in software development [12], [13], [14], [15], [16], [17], [18], [19].”
Influential
- Authors
- Aggarwal, K., Salameh, M., & Hindle, A.
- Affiliations
- University of Alberta (CA)
- Publisher
- PeerJ
- Published
- 2015-10-29
- OpenAlex
- W1846534677
- Cited by
- 20
- References
- 0
- Citations by year
- 2026: 3 · 2025: 2 · 2024: 2 · 2023: 3 · 2022: 2 · 2021: 4 · 2020: 3 · 2018: 1
- Type
- posted content
- Language
- en
- Open access
- green
- doi.org
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Social Sciences › Arts and Humanities › Language and Linguistics › Translation Studies and Practices
- Keywords
- statistical machine translation, program translation, programming language translation, BLEU evaluation
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review