知识卡片
切分数量应核对实际比例
51467条样本按test_size=0.1切分,测试约5147条;书中48893与2574更接近5%划分。应保存实际split索引与种子,不能拼接不一致输出作为复现结果;多语对齐语料还可检查同书或重复句泄漏。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Listing 9.3 Loading a translation dataset in Hugging Face format >>> sents = opus['train'].train_test_split(test_size=.1) >>> sents DatasetDict({ train: Dataset({ features: ['id', 'translation'], num_rows: 48893 }) test: Dataset({ features: ['id', 'translation'], num_rows: 2574 }) }) It’s always a good idea to examine some examples in your dataset before you start a long training run. This can help you make sure the data is what you expect.
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第09章《可堆叠的Transformer》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-9.html)
- 结论依据:摘录中关于切分数量应核对实际比例的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Listing 9.3 Loading a translation dataset in Hugging Face format >>> sents = opus['train'].train_test_split(test_size=.1) >>> sents DatasetDict({ train: Dataset({ features: ['id', 'translation'], num_rows: 48893 }) test: Dataset({ features: ['id', 'translation'], num_rows: 2574 }) }) It’s always a good idea to examine some examples in your dataset before you start a long training run. This can help you make sure the data is what you expect.