lewtun HF Staff commited on
Commit
18f68fa
·
verified ·
1 Parent(s): d221330

Add organism-specific 3_species_cls subsets

Browse files
README.md CHANGED
@@ -100,6 +100,94 @@ dataset_info:
100
  num_examples: 600
101
  download_size: 996782
102
  dataset_size: 1243475
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  configs:
104
  - config_name: binary
105
  data_files:
@@ -121,6 +209,22 @@ configs:
121
  data_files:
122
  - split: train
123
  path: mcq_600/train-*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  ---
125
 
126
  # GenomeQA
@@ -174,6 +278,10 @@ headline score is needed.
174
  | `mcq` | 2,600 | Full benchmark in four-option multiple-choice format. |
175
  | `binary_600` | 600 | Lower-cost binary subset with 100 examples from each of the six subtasks. |
176
  | `mcq_600` | 600 | Lower-cost MCQ subset with 100 examples from each of the six subtasks. |
 
 
 
 
177
  | `eukaryote_cls` | 1,000 | Auxiliary four-option eukaryotic taxonomy set stored separately from the original 5,200-example benchmark. |
178
 
179
  The `binary_600` and `mcq_600` configurations were sampled without replacement using seed 42 from source revision
@@ -182,6 +290,13 @@ shuffled so the rows are not stored in subtask blocks. These subsets are balance
182
  by every internal label or question dimension. See
183
  [`scripts/create_600_subsets.py`](scripts/create_600_subsets.py) for the reproducible generation script.
184
 
 
 
 
 
 
 
 
185
  ## Data fields
186
 
187
  | Field | Description |
@@ -202,6 +317,7 @@ from datasets import load_dataset
202
 
203
  binary = load_dataset("HuggingFaceBio/genomeqa", "binary", split="train")
204
  representative_mcq = load_dataset("HuggingFaceBio/genomeqa", "mcq_600", split="train")
 
205
  ```
206
 
207
  ## Citation
 
100
  num_examples: 600
101
  download_size: 996782
102
  dataset_size: 1243475
103
+ - config_name: binary_eukaryote
104
+ features:
105
+ - name: id
106
+ dtype: int64
107
+ - name: subtask
108
+ dtype: string
109
+ - name: question
110
+ dtype: string
111
+ - name: options
112
+ list: string
113
+ - name: answer_index
114
+ dtype: int64
115
+ - name: answer_text
116
+ dtype: string
117
+ - name: metadata
118
+ dtype: string
119
+ splits:
120
+ - name: train
121
+ num_bytes: 198070
122
+ num_examples: 170
123
+ download_size: 92539
124
+ dataset_size: 198070
125
+ - config_name: binary_prokaryote
126
+ features:
127
+ - name: id
128
+ dtype: int64
129
+ - name: subtask
130
+ dtype: string
131
+ - name: question
132
+ dtype: string
133
+ - name: options
134
+ list: string
135
+ - name: answer_index
136
+ dtype: int64
137
+ - name: answer_text
138
+ dtype: string
139
+ - name: metadata
140
+ dtype: string
141
+ splits:
142
+ - name: train
143
+ num_bytes: 174961
144
+ num_examples: 150
145
+ download_size: 84047
146
+ dataset_size: 174961
147
+ - config_name: mcq_eukaryote
148
+ features:
149
+ - name: id
150
+ dtype: int64
151
+ - name: subtask
152
+ dtype: string
153
+ - name: question
154
+ dtype: string
155
+ - name: options
156
+ list: string
157
+ - name: answer_index
158
+ dtype: int64
159
+ - name: answer_text
160
+ dtype: string
161
+ - name: metadata
162
+ dtype: string
163
+ splits:
164
+ - name: train
165
+ num_bytes: 681920
166
+ num_examples: 177
167
+ download_size: 567585
168
+ dataset_size: 681920
169
+ - config_name: mcq_prokaryote
170
+ features:
171
+ - name: id
172
+ dtype: int64
173
+ - name: subtask
174
+ dtype: string
175
+ - name: question
176
+ dtype: string
177
+ - name: options
178
+ list: string
179
+ - name: answer_index
180
+ dtype: int64
181
+ - name: answer_text
182
+ dtype: string
183
+ - name: metadata
184
+ dtype: string
185
+ splits:
186
+ - name: train
187
+ num_bytes: 599809
188
+ num_examples: 165
189
+ download_size: 495373
190
+ dataset_size: 599809
191
  configs:
192
  - config_name: binary
193
  data_files:
 
209
  data_files:
210
  - split: train
211
  path: mcq_600/train-*
212
+ - config_name: binary_eukaryote
213
+ data_files:
214
+ - split: train
215
+ path: binary_eukaryote/train-*
216
+ - config_name: binary_prokaryote
217
+ data_files:
218
+ - split: train
219
+ path: binary_prokaryote/train-*
220
+ - config_name: mcq_eukaryote
221
+ data_files:
222
+ - split: train
223
+ path: mcq_eukaryote/train-*
224
+ - config_name: mcq_prokaryote
225
+ data_files:
226
+ - split: train
227
+ path: mcq_prokaryote/train-*
228
  ---
229
 
230
  # GenomeQA
 
278
  | `mcq` | 2,600 | Full benchmark in four-option multiple-choice format. |
279
  | `binary_600` | 600 | Lower-cost binary subset with 100 examples from each of the six subtasks. |
280
  | `mcq_600` | 600 | Lower-cost MCQ subset with 100 examples from each of the six subtasks. |
281
+ | `binary_eukaryote` | 170 | Binary `3_species_cls` questions whose target organism is eukaryotic. |
282
+ | `binary_prokaryote` | 150 | Binary `3_species_cls` questions whose target organism is prokaryotic. |
283
+ | `mcq_eukaryote` | 177 | MCQ `3_species_cls` questions whose target organism is eukaryotic. |
284
+ | `mcq_prokaryote` | 165 | MCQ `3_species_cls` questions whose target organism is prokaryotic. |
285
  | `eukaryote_cls` | 1,000 | Auxiliary four-option eukaryotic taxonomy set stored separately from the original 5,200-example benchmark. |
286
 
287
  The `binary_600` and `mcq_600` configurations were sampled without replacement using seed 42 from source revision
 
290
  by every internal label or question dimension. See
291
  [`scripts/create_600_subsets.py`](scripts/create_600_subsets.py) for the reproducible generation script.
292
 
293
+ The organism-specific configurations contain only rows from the `3_species_cls` subtask and preserve their source
294
+ order. The target organism is read from `metadata`: `true` for binary `1_identity` and MCQ `basic_class` questions,
295
+ `target` for MCQ `reverse_search` questions, and `minority` for MCQ `odd_one_out` questions because the minority class
296
+ is the sequence the model must identify. Eukaryote and prokaryote subsets are disjoint within each answer format;
297
+ virus rows are not included. See
298
+ [`scripts/create_organism_subsets.py`](scripts/create_organism_subsets.py) for the reproducible filtering script.
299
+
300
  ## Data fields
301
 
302
  | Field | Description |
 
317
 
318
  binary = load_dataset("HuggingFaceBio/genomeqa", "binary", split="train")
319
  representative_mcq = load_dataset("HuggingFaceBio/genomeqa", "mcq_600", split="train")
320
+ eukaryote_mcq = load_dataset("HuggingFaceBio/genomeqa", "mcq_eukaryote", split="train")
321
  ```
322
 
323
  ## Citation
binary_eukaryote/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59799e1374c27c6224926a77e4419c8f09e94cc89e62034e8c7c30ee8f19d5f1
3
+ size 92539
binary_prokaryote/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30a44db3c5da3c2da566c4b4302ebbb38f2c85070bf65003edcfbdd5485786a7
3
+ size 84047
mcq_eukaryote/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9e66c503bf3314196c8c34f6160f0ad7db4f47b7632be0517b1730f4875252b
3
+ size 567585
mcq_prokaryote/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6aa8db7c3281415330257d8729288cb999b772f7fc8a29e0487d521b07826bb
3
+ size 495373
scripts/create_organism_subsets.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Create GenomeQA 3_species_cls subsets grouped by target organism."""
2
+
3
+ import argparse
4
+ import json
5
+ from pathlib import Path
6
+
7
+ from datasets import load_dataset
8
+
9
+
10
+ DATASET_ID = "HuggingFaceBio/genomeqa"
11
+ SOURCE_REVISION = "d2213306c6cf5b4568a504f87f86ea50b03eeced"
12
+ SOURCE_CONFIGS = ("binary", "mcq")
13
+ ORGANISMS = ("eukaryote", "prokaryote")
14
+ SUBTASK = "3_species_cls"
15
+ ORGANISM_KEY_BY_DIMENSION = {
16
+ "1_identity": "true",
17
+ "basic_class": "true",
18
+ "reverse_search": "target",
19
+ "odd_one_out": "minority",
20
+ }
21
+
22
+
23
+ def get_organism(metadata: str) -> str:
24
+ metadata_dict = json.loads(metadata)
25
+ dimension = metadata_dict["dim"]
26
+ return metadata_dict[ORGANISM_KEY_BY_DIMENSION[dimension]]
27
+
28
+
29
+ def create_subsets(config: str, output_dir: Path) -> None:
30
+ dataset = load_dataset(DATASET_ID, config, split="train", revision=SOURCE_REVISION)
31
+ species_dataset = dataset.filter(lambda example: example["subtask"] == SUBTASK)
32
+
33
+ for organism in ORGANISMS:
34
+ subset = species_dataset.filter(
35
+ lambda example, organism=organism: get_organism(example["metadata"]) == organism
36
+ )
37
+ if not subset:
38
+ raise RuntimeError(f"No {organism} rows found in {config}")
39
+ if any(get_organism(metadata) != organism for metadata in subset["metadata"]):
40
+ raise RuntimeError(f"Generated {config}_{organism} subset contains another organism")
41
+
42
+ config_dir = output_dir / f"{config}_{organism}"
43
+ config_dir.mkdir(parents=True, exist_ok=True)
44
+ subset.to_parquet(config_dir / "train-00000-of-00001.parquet")
45
+
46
+
47
+ def main() -> None:
48
+ parser = argparse.ArgumentParser()
49
+ parser.add_argument("--output-dir", type=Path, default=Path.cwd())
50
+ args = parser.parse_args()
51
+
52
+ for config in SOURCE_CONFIGS:
53
+ create_subsets(config, args.output_dir)
54
+
55
+
56
+ if __name__ == "__main__":
57
+ main()