theodorebiadala's picture
add rounds 5 to 8, the reviews and the analysis
b78499d verified
Raw History Blame Contribute Delete
829 Bytes
"""Split round6/results.jsonl into round6-old (cases B) and round6-new (cases W), and check the counts."""
import collections
import json
import pathlib
S = pathlib.Path(__file__).resolve().parent
rows = [json.loads(line) for line in (S / "round6" / "results.jsonl").read_text(encoding="utf-8").splitlines()]
keys = collections.Counter((r["arm"], r["model"], r["case"], r["run"]) for r in rows)
print(len(rows), collections.Counter(r["arm"] for r in rows), "duplicates", sum(v > 1 for v in keys.values()))
for name, prefix in (("round6-old", "B"), ("round6-new", "W")):
out = S / name
out.mkdir(exist_ok=True)
kept = [r for r in rows if r["case"].startswith(prefix)]
(out / "results.jsonl").write_text("".join(json.dumps(r, ensure_ascii=False) + "\n" for r in kept), encoding="utf-8")
print(name, len(kept))