takehika/wanli-ja-nli
收藏资源简介:
--- language: - ja - en license: cc-by-4.0 configs: - config_name: ja_only data_files: - split: train path: data/ja_only/train.parquet - split: test path: data/ja_only/test.parquet - config_name: bilingual data_files: - split: train path: data/bilingual/train.parquet - split: test path: data/bilingual/test.parquet task_categories: - text-classification task_ids: - natural-language-inference tags: - nli - wanli - japanese - translation size_categories: - 10K<n<100K --- # wanli-ja-nli **wanli-ja-nli** is a Japanese NLI dataset derived from [WANLI](https://huggingface.co/datasets/alisawuffles/WANLI), created by translating English premise-hypothesis pairs into Japanese and applying quality filtering. Each record keeps source linkage fields (`source_id`, `source_pairID`) so users can trace back to the original WANLI example. This repository provides two dataset configs: - `ja_only`: training-oriented Japanese-only fields - `bilingual`: English + Japanese parallel fields ## Quickstart ```python from datasets import load_dataset # Japanese-only ja = load_dataset("takehika/wanli-ja-nli", "ja_only") print(ja["train"][0]) # English-Japanese parallel bi = load_dataset("takehika/wanli-ja-nli", "bilingual") print(bi["train"][0]) ``` ## Dataset Overview - Source dataset: `alisawuffles/WANLI` - Source split sizes: - `train`: 102,885 - `test`: 5,000 - This derived dataset contains accepted rows only: - `train`: 73,942 - `test`: 3,505 - Record-level linkage fields to source WANLI: - `source_id` (WANLI `id`) - `source_pairID` (WANLI `pairID`) ## Configs ### `ja_only` Files: - `data/ja_only/train.parquet` (73,942 rows) - `data/ja_only/test.parquet` (3,505 rows) Fields: - `source_id` - `source_pairID` - `source_split` - `source_row_id_internal` - `premise` - `hypothesis` - `gold` ### `bilingual` Files: - `data/bilingual/train.parquet` (73,942 rows) - `data/bilingual/test.parquet` (3,505 rows) Fields: - `source_id` - `source_pairID` - `source_split` - `source_row_id_internal` - `premise_en` - `hypothesis_en` - `premise_ja` - `hypothesis_ja` - `gold` ## Label Space - `entailment` - `neutral` - `contradiction` ## Processing 1. Translate WANLI English premise/hypothesis pairs into Japanese. 2. Stage-1 filtering: - hard constraints: no numeric mismatch flags in premise/hypothesis - length ratio constraint: `0.30 <= len_ratio <= 2.40` - self-score thresholds 3. Stage-2 judge audit: - Input: `premise_en`, `hypothesis_en`, `gold`, `premise_ja`, `hypothesis_ja` - Decision: whether the translation preserves NLI validity (`pass=true/false`) 4. Final acceptance rule: - accept only rows that pass both Stage-1 and Stage-2 Notes: - Translation is LLM-based, and final acceptance combines rule-based Stage-1 checks with LLM-based signals and LLM-based Stage-2 judging. - Stage-1 uses fixed thresholds in this release. ## Label Distribution Shift (Source vs Accepted) This release publishes accepted rows only, so label proportions are shifted from source WANLI. Train split: - Source WANLI (102,885): entailment 37.43% (38,511), neutral 47.60% (48,977), contradiction 14.97% (15,397) - This dataset (73,942): entailment 41.42% (30,626), neutral 42.13% (31,155), contradiction 16.45% (12,161) - Retention by label vs source: entailment 79.53%, neutral 63.61%, contradiction 78.98% Test split: - Source WANLI (5,000): entailment 37.16% (1,858), neutral 47.94% (2,397), contradiction 14.90% (745) - This dataset (3,505): entailment 41.74% (1,463), neutral 41.31% (1,448), contradiction 16.95% (594) - Retention by label vs source: entailment 78.74%, neutral 60.41%, contradiction 79.73% Practical implication: - Neutral examples are relatively more likely to be filtered out than entailment/contradiction. - Use caution when comparing absolute scores against models trained/evaluated on original WANLI. ## Source and Attribution - Original dataset: [alisawuffles/WANLI](https://huggingface.co/datasets/alisawuffles/WANLI) — CC BY 4.0 - This dataset is an adapted/translated derivative of WANLI. - Modifications made in this derivative: - translated `premise` / `hypothesis` from English to Japanese - applied two-stage quality filtering - released accepted subset only - preserved record-level linkage fields (`source_id`, `source_pairID`) to the original WANLI records ## License - This dataset is licensed under CC BY 4.0. ## Limitations - This dataset is machine-translated and automatically filtered/judged; residual translation and label-consistency errors may remain. - Domain and style follow WANLI characteristics; transfer to other domains may vary. ## Citation ```bibtex @misc{liu-etal-2022-wanli, title = "WANLI: Worker and AI Collaboration for Natural Language Inference Dataset Creation", author = "Liu, Alisa and Swayamdipta, Swabha and Smith, Noah A. and Choi, Yejin", month = jan, year = "2022", url = "https://arxiv.org/pdf/2201.05955", } ```
--- 语言: - 日语(ja) - 英语(en) 许可证:CC BY 4.0 配置项: - 配置名称:ja_only(仅日语) 数据文件: - 划分:训练集 路径:data/ja_only/train.parquet - 划分:测试集 路径:data/ja_only/test.parquet - 配置名称:bilingual(双语) 数据文件: - 划分:训练集 路径:data/bilingual/train.parquet - 划分:测试集 路径:data/bilingual/test.parquet 任务类别: - 文本分类 任务子任务: - 自然语言推理(Natural Language Inference, NLI) 标签: - nli - wanli - 日语(japanese) - 机器翻译(translation) 数据规模: - 10K < n < 100K --- # wanli-ja-nli **wanli-ja-nli** 是源自[WANLI](https://huggingface.co/datasets/alisawuffles/WANLI)的日语自然语言推理(Natural Language Inference, NLI)数据集,通过将英语前提-假设对翻译为日语并经过质量过滤构建而成。每条记录均保留了源关联字段(`source_id`、`source_pairID`),方便使用者回溯至原始WANLI示例。 本仓库提供两种数据集配置: - `ja_only`:面向训练的纯日语字段配置 - `bilingual`:英语与日语并行字段配置 ## 快速入门 python from datasets import load_dataset # 仅日语配置 ja = load_dataset("takehika/wanli-ja-nli", "ja_only") print(ja["train"][0]) # 英日双语配置 bi = load_dataset("takehika/wanli-ja-nli", "bilingual") print(bi["train"][0]) ## 数据集概览 - 源数据集:`alisawuffles/WANLI` - 源数据集划分规模: - 训练集:102,885条 - 测试集:5,000条 - 本衍生数据集仅包含通过筛选的样本: - 训练集:73,942条 - 测试集:3,505条 - 用于关联至原始WANLI数据集的记录级字段: - `source_id`(对应WANLI的`id`字段) - `source_pairID`(对应WANLI的`pairID`字段) ## 配置项 ### `ja_only`(仅日语配置) 文件: - `data/ja_only/train.parquet`(73,942条样本) - `data/ja_only/test.parquet`(3,505条样本) 字段: - `source_id` - `source_pairID` - `source_split` - `source_row_id_internal` - `premise`(前提) - `hypothesis`(假设) - `gold`(金标标签) ### `bilingual`(双语配置) 文件: - `data/bilingual/train.parquet`(73,942条样本) - `data/bilingual/test.parquet`(3,505条样本) 字段: - `source_id` - `source_pairID` - `source_split` - `source_row_id_internal` - `premise_en`(英语前提) - `hypothesis_en`(英语假设) - `premise_ja`(日语前提) - `hypothesis_ja`(日语假设) - `gold`(金标标签) ## 标签空间 - 蕴含(entailment) - 中性(neutral) - 矛盾(contradiction) ## 数据处理流程 1. 将WANLI中的英语前提-假设对翻译为日语。 2. 第一阶段过滤: - 硬性约束:前提与假设中无数值不匹配标记 - 长度比例约束:`0.30 ≤ 长度比例 ≤ 2.40` - 自评分阈值 3. 第二阶段评审审核: - 输入:`premise_en`、`hypothesis_en`、`gold`、`premise_ja`、`hypothesis_ja` - 判定规则:翻译是否保留了自然语言推理的有效性(`pass=true/false`) 4. 最终接受规则: - 仅接受同时通过第一阶段与第二阶段过滤的样本 ### 注释 - 翻译基于大语言模型(Large Language Model, LLM)完成,最终样本接受规则结合了第一阶段的基于规则的检查、大语言模型生成的信号以及大语言模型驱动的第二阶段评审。 - 本版本中第一阶段过滤使用固定阈值。 ## 标签分布偏移(源数据集与接受样本对比) 本版本仅发布通过筛选的样本,因此标签比例与原始WANLI数据集存在偏移。 ### 训练集划分 - 原始WANLI数据集(102,885条):蕴含(entailment)37.43%(38,511)、中性(neutral)47.60%(48,977)、矛盾(contradiction)14.97%(15,397) - 本数据集(73,942条):蕴含41.42%(30,626)、中性42.13%(31,155)、矛盾16.45%(12,161) - 各标签保留率(相对于源数据集):蕴含79.53%、中性63.61%、矛盾78.98% ### 测试集划分 - 原始WANLI数据集(5,000条):蕴含37.16%(1,858)、中性47.94%(2,397)、矛盾14.90%(745) - 本数据集(3,505条):蕴含41.74%(1,463)、中性41.31%(1,448)、矛盾16.95%(594) - 各标签保留率(相对于源数据集):蕴含78.74%、中性60.41%、矛盾79.73% ### 实际应用启示 - 中性样本相较于蕴含与矛盾样本,被过滤的概率相对更高。 - 若将基于本数据集训练或评估的模型与基于原始WANLI数据集的模型进行绝对性能对比时,请谨慎处理。 ## 来源与归因 - 原始数据集:[alisawuffles/WANLI](https://huggingface.co/datasets/alisawuffles/WANLI) — 采用CC BY 4.0许可证 - 本数据集是WANLI的适配翻译衍生版本。 - 本衍生版本所做的修改: 1. 将`premise`(前提)与`hypothesis`(假设)从英语翻译为日语 2. 应用两阶段质量过滤流程 3. 仅发布通过筛选的子集 4. 保留了记录级关联字段(`source_id`、`source_pairID`),用于指向原始WANLI记录 ## 许可证 - 本数据集采用CC BY 4.0许可证发布。 ## 局限性 - 本数据集为机器翻译并经过自动过滤与评审,可能仍存在残留的翻译错误与标签一致性问题。 - 数据集的领域与风格遵循WANLI的特征,迁移至其他领域的效果可能存在差异。 ## 引用 bibtex @misc{liu-etal-2022-wanli, title = "WANLI: Worker and AI Collaboration for Natural Language Inference Dataset Creation", author = "Liu, Alisa and Swayamdipta, Swabha and Smith, Noah A. and Choi, Yejin", month = jan, year = "2022", url = "https://arxiv.org/pdf/2201.05955", }



