Datasets:
Sedweave real train/dev/frozen data with original and unselected candidate evaluations
d96cf4e verified Download prepare_real_splits.py from asterbraid/sedweave-real-data: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/datasets/asterbraid/sedweave-real-data/resolve/main/prepare_real_splits.py
- Command line
-
hf download hf://datasets/asterbraid/sedweave-real-data/prepare_real_splits.py
-
curl -L -o prepare_real_splits.py https://huggingface.co/datasets/asterbraid/sedweave-real-data/resolve/main/prepare_real_splits.py
1.6 kB
| from __future__ import annotations | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| def main() -> None: | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--questions", type=Path, required=True) | |
| parser.add_argument("--output-dir", type=Path, required=True) | |
| parser.add_argument("--manifest", type=Path, required=True) | |
| args = parser.parse_args() | |
| questions = json.loads(args.questions.read_text(encoding="utf-8"))["items"] | |
| if len(questions) != 400: | |
| raise ValueError("Expected exactly 400 ranked questions") | |
| groups = { | |
| "excluded_initial_benchmark": questions[:100], | |
| "train_candidates": questions[100:300], | |
| "frozen_test_candidates": questions[300:400], | |
| } | |
| args.output_dir.mkdir(parents=True, exist_ok=True) | |
| manifest = {} | |
| for name, items in groups.items(): | |
| if name != "excluded_initial_benchmark": | |
| (args.output_dir / f"{name}.json").write_text(json.dumps({"items": items}, indent=2), encoding="utf-8") | |
| manifest[name] = { | |
| "ranks": [questions.index(items[0]) + 1, questions.index(items[-1]) + 1], | |
| "question_ids": [item["question_id"] for item in items], | |
| } | |
| all_ids = [item["question_id"] for items in groups.values() for item in items] | |
| if len(all_ids) != len(set(all_ids)): | |
| raise ValueError("Duplicate question IDs across source splits") | |
| args.manifest.write_text(json.dumps(manifest, indent=2), encoding="utf-8") | |
| print(json.dumps({name: len(items) for name, items in groups.items()}, indent=2)) | |
| if __name__ == "__main__": | |
| main() | |