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

BLEU评分是否适用于代码迁移?

Does BLEU Score Work for Code Migration?

The University of Texas at Dallas(德克萨斯大学达拉斯分校);Iowa State University(爱荷华州立大学)

Ngoc Tran, Hieu Tran, Son Nguyen, Hoan Nguyen, Tien N. Nguyen

摘要:

统计机器翻译(SMT)是计算语言学的一个快速发展的分支。到目前为止,衡量SMT质量最流行的自动度量标准是双语评估替补(BLEU)分数。最近,SMT与BLEU度量一起被应用于名为代码迁移的软件工程任务。验证BLEU评分的使用可以促进基于SMT的代码迁移工具的研究和开发。不幸的是,没有研究批准或不批准对源代码使用BLEU评分。在本文中,我们进行了一个实证研究的BLEU评分(中)验证其适用于代码迁移任务,由于其无法反映源代码的语义。在我们的工作中,我们使用人类的判断作为地面真理来衡量迁移代码的语义正确性。我们的实证研究表明,BLEU不反映翻译质量,由于其弱相关性的翻译代码的语义正确性。我们提供了反例来证明BLEU在比较基于SMT的模型之间的翻译质量方面是无效的。由于BLEU的代码迁移任务的无效性,我们提出了一个替代度量RUBY,它考虑了源代码的词法,语法和语义表示。我们验证了RUBY与迁移代码的语义正确性达到了更高的相关系数,0.775,而BLEU得分为0.583。我们还证实了RUBY在反映基于SMT的翻译模型的翻译质量变化方面的有效性。RUBY的优点使得它可以用来评估基于SMT的代码迁移模型。

英文摘要:

Statistical machine translation (SMT) is a fast-growing sub-field of computational linguistics. Until now, the most popular automatic metric to measure the quality of SMT is BiLingual Evaluation Understudy (BLEU) score. Lately, SMT along with the BLEU metric has been applied to a Software Engineering task named code migration. (In)Validating the use of BLEU score could advance the research and development of SMT-based code migration tools. Unfortunately, there is no study to approve or disapprove the use of BLEU score for source code. In this paper, we conducted an empirical study on BLEU score to (in)validate its suitability for the code migration task due to its inability to reflect the semantics of source code. In our work, we use human judgment as the ground truth to measure the semantic correctness of the migrated code. Our empirical study demonstrates that BLEU does not reflect translation quality due to its weak correlation with the semantic correctness of translated code. We provided counter-examples to show that BLEU is ineffective in comparing the translation quality between SMT-based models. Due to BLEU's ineffectiveness for code migration task, we propose an alternative metric RUBY, which considers lexical, syntactical, and semantic representations of source code. We verified that RUBY achieves a higher correlation coefficient with the semantic correctness of migrated code, 0.775 in comparison with 0.583 of BLEU score. We also confirmed the effectiveness of RUBY in reflecting the changes in translation quality of SMT-based translation models. With its advantages, RUBY can be used to evaluate SMT-based code migration models.

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

↑