数据集:
Tensor2Tensor 库使用的 WMT EnDe 翻译数据集。
基于 statmt.org 数据的翻译数据集。
版本根据不同年份和不同数据源存在,基础 wmt 可以选择您自己的数据/语言对创建自定义数据集。可以按如下步骤执行:
from datasets import inspect_dataset, load_dataset_builder
inspect_dataset("wmt_t2t", "path/to/scripts")
builder = load_dataset_builder(
"path/to/scripts/wmt_utils.py",
language_pair=("fr", "de"),
subsets={
datasets.Split.TRAIN: ["commoncrawl_frde"],
datasets.Split.VALIDATION: ["euelections_dev2019"],
},
)
# Standard version
builder.download_and_prepare()
ds = builder.as_dataset()
# Streamable version
ds = builder.as_streaming_dataset()
'validation' 的一个示例如下所示。
{
"translation": {
"de": "Just a test sentence.",
"en": "Just a test sentence."
}
}
所有拆分的数据字段都相同。
de-en| name | train | validation | test |
|---|---|---|---|
| de-en | 4592289 | 3000 | 3003 |
@InProceedings{bojar-EtAl:2014:W14-33,
author = {Bojar, Ondrej and Buck, Christian and Federmann, Christian and Haddow, Barry and Koehn, Philipp and Leveling, Johannes and Monz, Christof and Pecina, Pavel and Post, Matt and Saint-Amand, Herve and Soricut, Radu and Specia, Lucia and Tamchyna, Ale
{s}},
title = {Findings of the 2014 Workshop on Statistical Machine Translation},
booktitle = {Proceedings of the Ninth Workshop on Statistical Machine Translation},
month = {June},
year = {2014},
address = {Baltimore, Maryland, USA},
publisher = {Association for Computational Linguistics},
pages = {12--58},
url = {http://www.aclweb.org/anthology/W/W14/W14-3302}
}
感谢 @thomwolf , @patrickvonplaten 提供此数据集。