arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2504.11290cs.CL
收藏

自动化Python翻译

Automated Python Translation

George Mason University(乔治梅森大学);University of Central Florida(中佛罗里达大学)

Joshua Otten, Antonios Anastasopoulos, Kevin Moran

AI总结:

针对非英语使用者理解Python代码的障碍,提出将Python自然模态自动翻译成其他语言的任务,构建自动化管道并比较机器翻译与大语言模型策略,获取多库多语言翻译并测试质量,为通用Python提供路径。

摘要:

Python是工业和教育领域最常用的编程语言之一。其英文关键字、内置函数和模块使其在可读性和易写性方面接近伪代码。然而,非英语使用者可能无法体验到这些优势,甚至可能在理解Python代码时受到阻碍——因为其术语的英文属性增加了额外的认知负担。为此,我们提出将Python的自然模态(关键字、错误类型、标识符等)自动翻译成其他人类语言的任务。考虑到这些形式的缩写特性,以及高级数学/编程概念在不同语言间可能存在的不可译性,这带来了独特挑战。我们构建了一个自动化管道来将Python翻译成其他语言,比较了使用机器翻译和大型语言模型的策略。随后,我们利用该管道获取了五个常用Python库(pytorch、pandas、tensorflow、numpy和random)的七种语言翻译,并对其中法语、希腊语和孟加拉语的术语子集进行了质量测试。我们希望这能为创建通用Python提供更清晰的路径,使其无论国籍或语言背景都能被任何人访问。

英文摘要:

Python is one of the most commonly used programming languages in industry and education. Its English keywords and built-in functions/modules allow it to come close to pseudo-code in terms of its readability and ease of writing. However, those who do not speak English may not experience these advantages. In fact, they may even be hindered in their ability to understand Python code, as the English nature of its terms creates an additional layer of overhead. To that end, we introduce the task of automatically translating Python's natural modality (keywords, error types, identifiers, etc.) into other human languages. This presents a unique challenge, considering the abbreviated nature of these forms, as well as potential untranslatability of advanced mathematical/programming concepts across languages. We therefore create an automated pipeline to translate Python into other human languages, comparing strategies using machine translation and large language models. We then use this pipeline to acquire translations from five common Python libraries (pytorch, pandas, tensorflow, numpy, and random) in seven languages, and do a quality test on a subset of these terms in French, Greek, and Bengali. We hope this will provide a clearer path forward towards creating a universal Python, accessible to anyone regardless of nationality or language background.

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

↑