Buckets:

Pranav2748's picture
download
raw
1.17 kB
"""Print generated notes next to their decision (state, question, options, gold) for reading by hand."""
import json, sys, random
from collections import Counter
sys.path.insert(0, "/workspace/think-decide/src")
from gen_notes import option_texts, serialize
path, n = sys.argv[1], int(sys.argv[2]) if len(sys.argv) > 2 else 12
notes = [json.loads(l) for l in open(path)]
rows = {}
for l in open("/workspace/data/training-legacy/s1/canonical/train.jsonl"):
r = json.loads(l); rows[(r["case_id"], r["view_id"])] = r
print("reject:", Counter(x["reject"] for x in notes), " tokens: median", sorted(x["n_tokens"] for x in notes)[len(notes)//2],
"max", max(x["n_tokens"] for x in notes))
for x in random.Random(1).sample(notes, min(n, len(notes))):
r = rows[(x["case_id"], x["view_id"])]; (_, q), = r["questions"].items()
texts, names = option_texts(q)
print("=" * 100); print("[%s | %s | gold=%s | reject=%s]" % (x["source"], x["primitive"], x["gold_name"], x["reject"]))
print("STATE:", serialize(r["state"])[:400].replace("\n", " ")); print("Q:", q["instructions"][:200])
print("OPTIONS:", "; ".join(names)[:300]); print("NOTE:\n" + x["note"])

Xet Storage Details

Size:
1.17 kB
·
Xet hash:
3fa5e87c13a1ea2f36b597a531493b123af0c158edba0bdaa7af1775ba0a74b7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.