import hashlib import json from pathlib import Path BENCHMARK_NAME = "TurkishDecisionBenchmark" BENCHMARK_VERSION = "0.2" ROOT = Path(__file__).resolve().parent.parent DATASET_DIR = ROOT / "dataset" RESULTS_DIR = ROOT / "results" # Per version: task file and one JSONL per split. "hidden" is git-ignored. VERSIONS = { "0.2": { "tasks": DATASET_DIR / "v0.2" / "tasks.json", "splits": { "public": DATASET_DIR / "v0.2" / "public.jsonl", "hidden": DATASET_DIR / "v0.2" / "hidden.jsonl", }, }, } DATASET_PATH = VERSIONS[BENCHMARK_VERSION]["splits"]["public"] TASKS_PATH = VERSIONS[BENCHMARK_VERSION]["tasks"] def version_paths(version, split="public"): spec = VERSIONS[version] if split not in spec["splits"]: raise ValueError(f"v{version} has no split {split!r}; choose from {list(spec['splits'])}") return spec["splits"][split], spec["tasks"] def results_dir(version): return RESULTS_DIR / f"v{version}" def load_tasks(path=TASKS_PATH): return json.loads(Path(path).read_text(encoding="utf-8")) def load_cases(path=DATASET_PATH): path = Path(path) if not path.exists(): return [] with path.open("r", encoding="utf-8") as f: return [json.loads(line) for line in f if line.strip()] def sha256_file(path): return hashlib.sha256(Path(path).read_bytes()).hexdigest() def display_path(path): path = Path(path).resolve() try: return str(path.relative_to(ROOT)) except ValueError: return str(path)