🚀 TransQuest:基于跨语言Transformer的翻译质量评估
翻译质量评估(QE)旨在在没有参考译文的情况下评估翻译的质量。高精度且易于部署到多种语言对的QE技术,是许多商业翻译工作流程中所缺失的一环,因为它有众多潜在用途。当有多个翻译引擎可用时,它可用于选择最佳译文;也能让终端用户了解自动翻译内容的可靠性。此外,QE系统可用于判断译文在特定上下文中是否可直接发布,或者在发布前是否需要人工后编辑,又或者是否需要人工重新翻译。质量评估可以在不同层面进行:文档级、句子级和单词级。
借助TransQuest,我们将翻译质量评估方面的研究成果开源,该成果还赢得了WMT 2020句子级直接评估质量评估共享任务。TransQuest的表现优于当前的开源质量评估框架,如OpenKiwi和DeepQuest。
✨ 主要特性
- 句子级翻译质量评估,涵盖预测后编辑工作量和直接评估两个方面。
- 单词级翻译质量评估,能够预测源单词、目标单词和目标间隙的质量。
- 在所有实验语言中,表现优于当前最先进的质量评估方法,如DeepQuest和OpenKiwi。
- 在HuggingFace上提供了十五种语言对的预训练质量评估模型。
📦 安装指南
通过pip安装
pip install transquest
从源代码安装
git clone https://github.com/TharinduDR/TransQuest.git
cd TransQuest
pip install -r requirements.txt
💻 使用示例
基础用法
from transquest.algo.word_level.microtransquest.run_model import MicroTransQuestModel
import torch
model = MicroTransQuestModel("xlmroberta", "TransQuest/microtransquest-en_zh-wiki", labels=["OK", "BAD"], use_cuda=torch.cuda.is_available())
source_tags, target_tags = model.predict([["if not , you may not be protected against the diseases . ", "ja tā nav , Jūs varat nepasargāt no slimībām . "]])
📚 详细文档
更多详细信息请参考以下文档:
- 安装 - 使用pip在本地安装TransQuest。
- 架构 - 查看TransQuest中实现的架构
- 句子级架构 - 我们发布了两种架构:MonoTransQuest和SiameseTransQuest,用于进行句子级质量评估。
- 单词级架构 - 我们发布了MicroTransQuest,用于进行单词级质量评估。
- 示例 - 我们提供了几个关于如何在最近的WMT质量评估共享任务中使用TransQuest的示例。
- 句子级示例
- 单词级示例
- 预训练模型 - 我们提供了涵盖句子级和单词级的十五种语言对的预训练质量评估模型。
- 句子级模型
- 单词级模型
- 联系我们 - 如有任何关于TransQuest的问题,请联系我们。
📄 许可证
本项目采用Apache 2.0许可证。
📖 引用
如果您使用单词级架构,请考虑引用这篇已被ACL 2021接受的论文:
@InProceedings{ranasinghe2021,
author = {Ranasinghe, Tharindu and Orasan, Constantin and Mitkov, Ruslan},
title = {An Exploratory Analysis of Multilingual Word Level Quality Estimation with Cross-Lingual Transformers},
booktitle = {Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics},
year = {2021}
}
如果您使用句子级架构,请考虑引用这些在COLING 2020和WMT 2020(于EMNLP 2020期间)上发表的论文:
@InProceedings{transquest:2020a,
author = {Ranasinghe, Tharindu and Orasan, Constantin and Mitkov, Ruslan},
title = {TransQuest: Translation Quality Estimation with Cross-lingual Transformers},
booktitle = {Proceedings of the 28th International Conference on Computational Linguistics},
year = {2020}
}
@InProceedings{transquest:2020b,
author = {Ranasinghe, Tharindu and Orasan, Constantin and Mitkov, Ruslan},
title = {TransQuest at WMT2020: Sentence-Level Direct Assessment},
booktitle = {Proceedings of the Fifth Conference on Machine Translation},
year = {2020}
}