chinese-squadv2 / README.md
real-jiakai's picture
docs: add Chinese dataset card with language switcher (English remains default)
5ba5df5 verified
|
Raw
History Blame Contribute Delete
11.6 kB
---
annotations_creators:
- machine-translated
- machine-generated
language_creators:
- machine-translated
language:
- zh
- en
license:
- cc-by-sa-4.0
multilinguality:
- translation
size_categories:
- 100K<n<1M
source_datasets:
- squad_v2
task_categories:
- question-answering
task_ids:
- open-domain-qa
- extractive-qa
pretty_name: Chinese SQuAD 2.0 (revised, with English originals)
dataset_info:
config_name: chinese_squadv2
features:
- name: id
dtype: string
- name: title
dtype: string
- name: context
dtype: string
- name: question
dtype: string
- name: answers
struct:
- name: text
sequence: string
- name: answer_start
sequence: int64
- name: title_en
dtype: string
- name: context_en
dtype: string
- name: question_en
dtype: string
- name: answers_en
struct:
- name: text
sequence: string
- name: answer_start
sequence: int64
- name: is_impossible
dtype: bool
- name: translation_source
dtype: string
splits:
- name: train
num_examples: 130162
- name: validation
num_examples: 11856
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: validation
path: data/validation-*
---
**English** | [中文](README_zh.md)
# Dataset Card for Chinese SQuAD 2.0 (revised, bilingual)
## Dataset Description
This is a revised and extended version of the Chinese translation of SQuAD 2.0,
originally machine-translated by
[ChineseSquad](https://github.com/junzeng-pluto/ChineseSquad). Like SQuAD 2.0 it
contains both answerable and unanswerable questions and is designed for Chinese
extractive reading comprehension / question answering.
Compared with the previous release of `chinese-squadv2`, this version:
1. **Adds the original English SQuAD 2.0 fields** (`title_en`, `context_en`,
`question_en`, `answers_en`, `is_impossible`), aligned to every example by the
original SQuAD id. For the validation split, `answers_en` restores **all**
human reference answers from the official dev set (deduplicated), not just one.
2. **Reviews and corrects the Chinese machine translation** of all
99,963 pre-existing examples. Every unique paragraph
together with its questions and answers was checked against the English original
by LLMs (grok-3-mini-fast: 9,797 paragraph groups, gemini-3-flash: 9,731,
qwen3.6-flash: 3, kimi-k2: 1) with a constrained-correction protocol:
corrections were accepted only if every Chinese answer remains a verbatim
substring of the (possibly corrected) Chinese context, and `answer_start`
offsets were recomputed programmatically. Typical fixed errors: mistranslated
terminology (e.g. 教会-图灵论点 -> 丘奇-图灵论题, 胶带 -> 纸带),
wrong senses (维多利亚时代 -> 维多利亚州), untranslated fragments (张R -> 张柔),
and garbled sentences.
3. **Recovers 42,055 of the 42,229 examples that the
original ChineseSquad project dropped** (answerable questions whose answer spans
could not be aligned after 2019-era machine translation). They were re-translated
with the same LLM pool under the same substring constraint: where the paragraph
already had a (corrected) Chinese context, only the question and answer span were
translated against that fixed context; 174
examples whose answers still could not be aligned remain excluded and are listed
in `corrections/unrecovered_*.jsonl`.
4. **Ships a full audit log** (`corrections/`) listing every changed example with
old/new text and the model that produced it, so all edits can be reviewed.
### Dataset Structure
```python
{
'id': string, # original SQuAD 2.0 id
'title': string, # Chinese article title
'context': string, # Chinese paragraph (revised)
'question': string, # Chinese question (revised)
'answers': {'text': List[string], 'answer_start': List[int]}, # in Chinese context
'title_en': string, # original English title
'context_en': string, # original English paragraph
'question_en': string, # original English question
'answers_en': {'text': List[string], 'answer_start': List[int]}, # in English context
'is_impossible': bool, # True = unanswerable (both answers lists empty)
'translation_source': string, # 'chinesesquad-revised' | 'llm-recovered'
}
```
Unanswerable questions have empty `answers` / `answers_en` lists, consistent with
the `squad_v2` convention. Rows are ordered following the official English
SQuAD 2.0 file order.
### Data Splits
| Split | Examples | Answerable | Unanswerable | of which recovered | Unique paragraphs |
|------------|----------|------------|--------------|--------------------|-------------------|
| train | 130,162 | 86,664 | 43,498 | 40,135 | 19,029 |
| validation | 11,856 | 5,911 | 5,945 | 1,920 | 1,204 |
Coverage vs the official English SQuAD 2.0: 130,162/130,319 train and
11,856/11,873 dev examples (157 + 17
examples could not be recovered; see `corrections/unrecovered_*.jsonl`).
All ids map 1:1 into the official English SQuAD 2.0.
### Revision statistics (pre-existing examples)
| Split | Examples changed | Context revised | Question revised | Answer text revised | Verified unchanged |
|-------|------------------|-----------------|------------------|---------------------|--------------------|
| train | 76,791 | 72,984 | 25,055 | 2,515 | 13,236 |
| validation | 8,846 | 8,480 | 3,005 | 310 | 1,090 |
`answer_start` offsets were recomputed for every example whose context changed.
All 19,532 unique paragraph groups were successfully reviewed; no example was left
unverified in this release. The span invariant (every Chinese answer appears
verbatim at its `answer_start` in its Chinese context) holds for 100% of examples.
### Usage
```python
from datasets import load_dataset
dataset = load_dataset("real-jiakai/chinese-squadv2")
example = dataset['train'][0]
print(example['question']) # Chinese question
print(example['question_en']) # original English question
print(example['answers']) # answer span in the Chinese context
print(example['answers_en']) # answer span(s) in the English context
# only the original (revised) ChineseSquad subset:
subset = dataset.filter(lambda e: e['translation_source'] == 'chinesesquad-revised')
```
### Revision process (August 12-13, 2026)
This revision was produced as a human + AI collaboration: the dataset author
directed the work (scope, model selection, rate limits, review policy,
publication), while **Claude Fable 5 (Anthropic), running as an autonomous
coding agent in the Cursor CLI**, wrote and operated all of the code.
Translation and review were delegated to external LLMs behind an
OpenAI-compatible proxy; the agent handled orchestration, validation and
assembly. The steps were:
1. **Alignment audit.** The previous parquet release, the original ChineseSquad
GitHub JSON and the official English SQuAD 2.0 files were cross-checked:
all 99,963 pre-existing examples map 1:1 by id into official SQuAD 2.0, and
all answer spans were mechanically valid before revision.
2. **English supplementation.** The English fields were joined by id as a pure
data step (no LLM involved), restoring all human reference answers for the
validation split.
3. **Translation review.** All 19,532 unique paragraph groups (paragraph +
its questions/answers) were reviewed - one request per group - by
grok-3-mini-fast (9,797 groups) and gemini-3-flash (9,731), with
qwen3.6-flash (3) and kimi-k2 (1) as fallbacks; doubao-seed-2.1-turbo was
configured but automatically disabled after repeated gateway timeouts.
Models returned strict-JSON verdicts with minimal corrections. A correction
was accepted only if every Chinese answer remained a verbatim substring of
the final Chinese context; `answer_start` offsets were always recomputed
programmatically, never taken from the model.
4. **Recovery of dropped examples.** The 42,229 examples dropped by the 2019
project were re-translated under the same substring constraint
(grok-3-mini-fast: 8,933 groups, gemini-3-flash: 8,818, kimi-k2: 1,
qwen3.6-flash: 1). Where the paragraph already had a corrected Chinese
context (95%+ of cases) the context was kept fixed and only the question
and answer span were translated; 701 paragraphs were translated from
scratch. 42,055 examples were recovered; 174 whose answers could not be
aligned remain excluded.
5. **Pipeline engineering.** The workflow is implemented as ~10 Python scripts:
a concurrent HTTP client with a global 1-request/second start-rate cap,
round-robin model rotation with automatic failure-based restriction,
resumable JSONL checkpointing, JSON-schema and substring validation with
cross-model retries, merge/reorder to the official SQuAD file order, and
full-dataset invariant checks (span integrity and answerability flags hold
for 100% of the 142,018 published rows).
In total the pipelines issued ~37,300 successful paragraph-group requests over
roughly 10 hours of wall-clock time.
### Citation
If you use this dataset, please cite the original SQuAD papers and the Chinese
translation project:
```bibtex
@inproceedings{rajpurkar-etal-2018-know,
title = "Know What You Don{'}t Know: Unanswerable Questions for {SQ}u{AD}",
author = "Rajpurkar, Pranav and Jia, Robin and Liang, Percy",
booktitle = "Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)",
year = "2018",
url = "https://aclanthology.org/P18-2124",
doi = "10.18653/v1/P18-2124",
pages = "784--789"
}
@inproceedings{rajpurkar-etal-2016-squad,
title = "{SQ}u{AD}: 100,000+ Questions for Machine Comprehension of Text",
author = "Rajpurkar, Pranav and Zhang, Jian and Lopyrev, Konstantin and Liang, Percy",
booktitle = "Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing",
year = "2016",
url = "https://aclanthology.org/D16-1264",
doi = "10.18653/v1/D16-1264",
pages = "2383--2392"
}
@misc{ChineseSquad,
title = "ChineseSquad",
author = "junzeng-pluto",
url = "https://github.com/junzeng-pluto/ChineseSquad"
}
```
### License
CC BY-SA 4.0, following the original SQuAD 2.0 license.
### Limitations
- Translations were machine-produced and machine-reviewed; residual errors are
possible. The audit log allows targeted human review.
- 174 examples of the official SQuAD 2.0 could
not be aligned and remain excluded (`corrections/unrecovered_*.jsonl`).
- The Chinese `answers` field keeps a single reference answer per answerable
question (the English `answers_en` field carries all references for validation).
- Recovered examples (`translation_source == 'llm-recovered'`) were translated by
LLMs in 2026 and did not go through the original ChineseSquad pipeline.
### Acknowledgements
- [ChineseSquad](https://github.com/junzeng-pluto/ChineseSquad) by junzeng-pluto,
the original machine translation this dataset builds on.
- The SQuAD authors for the original English dataset.
- **Claude Fable 5 (Anthropic), running in the Cursor CLI**, which performed the
alignment analysis, wrote and operated the review/recovery pipelines,
validated the results and assembled this release as an autonomous coding
agent, in collaboration with the dataset author.
- grok-3-mini-fast, gemini-3-flash, qwen3.6-flash and kimi-k2, the models that
performed the translation review and recovery translations.