lianghsun commited on
Commit
3fe61f1
·
verified ·
1 Parent(s): 23a4097

Build from 考選部 open data

Browse files
Files changed (3) hide show
  1. README.md +218 -0
  2. benchmark.csv +0 -0
  3. benchmark.jsonl +0 -0
README.md ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - zh
5
+ tags:
6
+ - benchmark
7
+ - evaluation
8
+ - taiwan
9
+ - zh-tw
10
+ - multiple-choice
11
+ - twinkle-eval
12
+ - tcm-basic
13
+ task_categories:
14
+ - question-answering
15
+ size_categories:
16
+ - 1K<n<10K
17
+ configs:
18
+ - config_name: default
19
+ data_files:
20
+ - split: test
21
+ path: benchmark.csv
22
+ ---
23
+
24
+ # Traditional Chinese Medicine — Basic Theory (中醫基礎醫學)
25
+
26
+ A multiple-choice benchmark for **Traditional Chinese Medicine — Basic Theory** — the subject 「中醫基礎醫學」 as
27
+ examined in Taiwan's national examinations, in Traditional Chinese. Built from the
28
+ papers published as open data by the **Ministry of Examination (考選部)**.
29
+
30
+ One dataset per **academic subject**: papers are grouped by the subject they examine,
31
+ not by the professional category sitting the exam.
32
+
33
+ Part of [**OpenTWBench**](https://huggingface.co/OpenTWBench) — an open evaluation suite for
34
+ Taiwan-domain knowledge.
35
+
36
+ ## Overview
37
+
38
+ | Property | Value |
39
+ |---|---:|
40
+ | Questions | **4,430** (deduplicated) |
41
+ | Years | 2012–2026 |
42
+ | Source papers parsed | 65 of 74 |
43
+ | Format | 4-choice single-answer (A/B/C/D) |
44
+ | Language | Traditional Chinese (zh-TW) |
45
+ | Framework | Twinkle Eval compatible |
46
+ | Field | medicine |
47
+
48
+ ## Fields
49
+
50
+ The row shape is the **Twinkle Eval MCQ** contract — `question`, `A`–`D`, `answer` —
51
+ with provenance columns alongside, which the harness ignores.
52
+
53
+ | Field | Description |
54
+ |---|---|
55
+ | `question` | Question stem |
56
+ | `A` / `B` / `C` / `D` | Option texts |
57
+ | `answer` | Gold option letter |
58
+ | `subject` | Full examination subject name (科目全名) |
59
+ | `subject_group` | Examination category (類科組別) |
60
+ | `exam_level` | Examination grade (等級分類) |
61
+ | `exam_name` | Official title of the examination |
62
+ | `year_roc` / `year_ce` | Exam year (ROC / CE calendar) |
63
+ | `q_no` | Question number on the original paper |
64
+ | `paper_id` | Originating paper identifier |
65
+ | `n_source_papers` | How many papers published this identical item |
66
+
67
+ ## Examination Categories
68
+
69
+ | 類科組別 | Questions |
70
+ |---|---:|
71
+ | 中醫師(一) | 4,122 |
72
+ | 中醫師 | 308 |
73
+
74
+ ## Examination Levels
75
+
76
+ | 等級分類 | Questions |
77
+ |---|---:|
78
+ | 專技高考 | 4,430 |
79
+
80
+ ## Usage
81
+
82
+ ### Twinkle Eval
83
+
84
+ ```bash
85
+ twinkle-eval --init
86
+ # point `dataset_paths` at a directory holding benchmark.jsonl, then:
87
+ twinkle-eval --config config.yaml --export json csv
88
+ ```
89
+
90
+ ### datasets
91
+
92
+ ```python
93
+ from datasets import load_dataset
94
+
95
+ ds = load_dataset("OpenTWBench/tw-tcm-basic-bench", split="test")
96
+ print(ds[0]["question"], ds[0]["answer"])
97
+ ```
98
+
99
+ ## Construction
100
+
101
+ 1. **Index** — the Ministry of Examination open-data index
102
+ (`wHandExamQandA_CSV.ashx`), filtered to multiple-choice papers that publish an
103
+ answer key.
104
+ 2. **Retrieval** — question and answer-key PDFs fetched directly, rate-limited and
105
+ cached.
106
+ 3. **Parsing** — PDF text layer extracted with PyMuPDF; see the hazards below.
107
+ 4. **Filtering and deduplication** — see below.
108
+
109
+ ### Parsing hazards handled
110
+
111
+ These silently corrupt naive extraction, so they are documented here:
112
+
113
+ - Option markers live in the **EUDC Private Use Area** (`U+E18C`–`U+E190` = A–E)
114
+ rather than as literal letters; some older layouts use `A.` or `(A)` instead.
115
+ - Text mixes **CJK Compatibility Ideographs**. Normalised with **NFC** — *not*
116
+ NFKC, which rewrites 「,」 to an ASCII comma.
117
+ - Answer-key PDFs are **grids whose text layer comes out shuffled**: question
118
+ labels and answer letters arrive in separate runs, sometimes out of order.
119
+ Pairing by reading order misaligns the entire paper, so cells are paired **by
120
+ page coordinates** instead, with the column tolerance derived from the grid pitch.
121
+ - The first answer cell of a row is often **glued to the row label** in the text
122
+ layer (`答案C`). Left unhandled, that cell goes missing and every label in the
123
+ row pairs with its right-hand neighbour — shifting the whole paper by one.
124
+ - Question numbers must run **1..N monotonically**: a bare number inside a stem
125
+ (frequent in quantitative papers) would otherwise start a phantom question.
126
+ - Answer letters may be **full-width** (`A`) and `#` marks a voided question.
127
+ - Papers mix **single-select and multi-select** sections; multi-select keys are
128
+ multi-letter tokens (`ABDE`).
129
+
130
+ Every paper is cross-checked against the question count its own answer sheet
131
+ declares (`單選題數`/`複選題數`/`題數`); a mismatch rejects the paper rather than
132
+ importing a silently shifted key.
133
+
134
+ ### Excluded
135
+
136
+ | Excluded | Count |
137
+ |---|---:|
138
+ | Multi-select items | 0 |
139
+ | Voided items (一律給分) | 52 |
140
+ | English-language items | 0 |
141
+ | Items referring to a figure or table | 14 |
142
+ | Follow-up items in a 題組 (「承上題」) | 24 |
143
+ | Items whose last option swallowed following text | 0 |
144
+ | Items not in 4-choice form | 53 |
145
+ | Items whose stem was displaced by table debris | 0 |
146
+ | Items whose duplicate keys disagreed | 0 |
147
+ | Items already in tw-legal-benchmark-v2 | 0 |
148
+ | Papers rejected by the answer-count check | 0 |
149
+ | Papers rejected as incompletely parsed | 9 |
150
+
151
+ Questions already published in
152
+ [`lianghsun/tw-legal-benchmark-v2`](https://huggingface.co/datasets/lianghsun/tw-legal-benchmark-v2)
153
+ are removed **item by item**, not by dropping whole domains: several 法規 subjects
154
+ (營建法規, 海巡法規, 郵政法規, 稅務法規) are examined inside otherwise non-legal
155
+ categories, so excluding the category would discard its non-legal questions too.
156
+
157
+ English items are detected from the **stem**, not by question number: the boundary
158
+ of the English section moves between years. Judging the options too would discard
159
+ the many Chinese questions that are answered in English terminology — 「下列何者可
160
+ 以抑制 ribonucleotide reductase 的活性?」 with options like `dATP` is a Chinese
161
+ question about Taiwan-examined knowledge, and a zh-TW model is expected to answer
162
+ it.
163
+
164
+ Items that point at a figure, table or reading passage printed on the paper are
165
+ removed — they are unanswerable from the text alone, and keeping them would make
166
+ every model look worse for the same reason. So are the follow-up questions of a
167
+ 題組, which open with 「承上題」 and refer to a scenario set up by the previous
168
+ question: the setup question is self-contained and stays, the follow-ups cannot
169
+ be answered by anyone once lifted out of the paper.
170
+
171
+ The last option on a paper has no following marker for the parser to stop at, so
172
+ table debris or the next question's text can run into it. Option texts are short
173
+ — the 99.9th percentile is 95 characters — so an option far outside that *and*
174
+ several times longer than its siblings is a parse failure, and the item is
175
+ dropped rather than shipped broken.
176
+
177
+ ### Deduplication
178
+
179
+ The same paper is republished under several examination categories, so the same
180
+ item recurs verbatim. Items are fingerprinted on their stem plus their sorted
181
+ option set; **604** duplicate groups were collapsed,
182
+ of which **0** carried disagreeing answer keys and
183
+ were dropped entirely rather than guessed. `n_source_papers` records the
184
+ multiplicity — **604** of the kept items were published more than once.
185
+
186
+ **A benchmark built from this source without deduplication is inflated**, and its
187
+ accuracy is skewed toward whichever subset happens to be republished most.
188
+
189
+ ## Known Properties
190
+
191
+ - **Answer-position distribution**: A=945, B=1,158, C=1,150, D=1,177.
192
+ Shuffle options when evaluating (`shuffle_options: true` is the Twinkle Eval default).
193
+ - **Contamination risk**: these are public past papers, widely discussed online and
194
+ very likely present in pretraining corpora. Absolute scores should be treated with
195
+ caution; the benchmark is most useful for **relative** comparison between models.
196
+ - **Answer extraction dominates low scores.** If a model scores near zero, check the
197
+ unparsed rate before believing the number — a model answering 「最終答案:C」 scores
198
+ very differently under `box` and `pattern` extraction. Match the extraction method
199
+ to the model.
200
+ - Item difficulty is set by the examination committee, not by us.
201
+
202
+ ## Licensing
203
+
204
+ Questions and answer keys are official publications of the Ministry of Examination,
205
+ Republic of China (Taiwan), released as open data. The packaging, parsing,
206
+ deduplication and metadata in this repository are provided under Apache-2.0. Users
207
+ intending redistribution should confirm the current terms published by 考選部.
208
+
209
+ ## Citation
210
+
211
+ ```bibtex
212
+ @misc{opentwbench_tcm_basic,
213
+ title = {Traditional Chinese Medicine — Basic Theory Benchmark (Taiwan)},
214
+ author = {Huang, Liang-Hsun},
215
+ year = {2026},
216
+ url = {https://huggingface.co/datasets/OpenTWBench/tw-tcm-basic-bench}
217
+ }
218
+ ```
benchmark.csv ADDED
The diff for this file is too large to render. See raw diff
 
benchmark.jsonl ADDED
The diff for this file is too large to render. See raw diff