File size: 829 Bytes
b78499d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""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))