diff --git a/README.md b/README.md index 6eee15b02c5b362768d70e7a29764d5c175e9ef0..400b8c920e71c64aa3d3f4b304baab4da5054e82 100644 --- a/README.md +++ b/README.md @@ -228,8 +228,12 @@ harbor run --repo https://huggingface.co/datasets/llamaindex/ExtractBenchPro -p Instructions reproduce the [published coding-agent prompt](https://arxiv.org/html/2607.29677v1#A3.SS1), with a standardized document filename. Agents receive only `document.pdf` and `schema.json` and write `output.json`. -The separate verifier uses the existing ExtractBench evaluator at commit `741c1b651e8851c1bd3424ac4d41b643b9e41761`. +The separate verifier uses the existing ExtractBench evaluator at commit `2f27f100730afc7c395602e26a2a87e07ea66b31`. The reward is Value F1 in [0, 1]; `metrics.json` also records perfect-document status. +`feedback.json` records aligned output/reference cell paths, value outcomes, and +each matched cell's contribution to the same F1 reward. Paths refer to normalized +scoring inputs; one-sided cells contribute to the denominator. This feedback does +not change the reward or assign credit to reasoning steps. This prompt does not request citations, so this lane does not measure grounding. The agent timeout is 1800 seconds per document. diff --git a/harbor-manifest.json b/harbor-manifest.json index 390703f895c2f07c96812e54b784e5d0f004232c..71b12fb427b52f53965a92a7b5e1415076552349 100644 --- a/harbor-manifest.json +++ b/harbor-manifest.json @@ -1,7 +1,7 @@ { "source_repo": "llamaindex/ExtractBenchPro", "source_revision": "16f6672e06cf77491ec6d18c817d67864b90d845", - "scorer_revision": "741c1b651e8851c1bd3424ac4d41b643b9e41761", + "scorer_revision": "2f27f100730afc7c395602e26a2a87e07ea66b31", "prompt_source": "https://arxiv.org/html/2607.29677v1#A3.SS1", "reward": "extract_unified_value_f1", "agent_timeout_sec": 1800, @@ -24,11 +24,11 @@ "instruction.md": "26fab39de6b9bf8f15fd49ab8412d7c4d538a0bb1c714f25477b38bda87e8d92", "solution/expected.json": "9e7ac546d00cf637539758d458d39585d08172d7094a290f0f2c74387d9d4d29", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "ba1fb40380032b862bdf7d8068b9fee36673e802862bf06b394b26bd2723836b", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "55b26434bade50e377b34cbbd649e6167b1ed7524bbcd016fe91efd18715a024", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "e0e1a6c6f395b3ef3bdca6a4416e89b3541ea9077302f29adee93c8b8e198381", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--clinical-listing-01-16558a50f4": { @@ -41,11 +41,11 @@ "instruction.md": "6132a0dc45eba19504c1ab4ddf44a701fbd87d5dfa1cbbf9e439b3feb1f37a4a", "solution/expected.json": "5adf8e7252412dee335614ff1a06f4a5f41010ecb78b844c0c1470949da6de9c", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "f8d384757ef9b4713e45c37a478db775f449bb6fc11af8aa915b3b8c4273b2fa", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "c9e7f0406cb0aeb1931e095c74e45ddcdd0ebf5fa44c35713c38cb1684e5c0da", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "5648645ea9aefa6554d7a71fac8a8818e50c333244a35678adce5d25d035f611", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--customs-entry-7501-01-2b38a10d05": { @@ -58,11 +58,11 @@ "instruction.md": "cb356ab21b5e2466479a8b60d36994f70a179bb1f308491cd10a55a6f9c56590", "solution/expected.json": "ebf1d636a02e3c9817cc5d1230ef64ae07f98cfdee58d64a2ff5db533a1e2a5c", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "9978fba647cb09227b1298a4accce03c17d77090b73fd35657122f0afe37c5a8", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "a97f379edf091021ebd281fae207aef1dc1ae89d911452eae31bf3c197fac934", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "4c606e773e8c29632857da692821b120f04f128140504f57704211db04f27cf8", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--gl-trial-balance-01-fcfae79cc4": { @@ -75,11 +75,11 @@ "instruction.md": "3146e2b91fb88b41b174aee38ff0945f7a29d40dcfbcb949d178d2011c04c253", "solution/expected.json": "8b2f2eae370cbc16046e85eaffa32f2efc1d453de57b89b8a811091a8d28f4bd", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "e03e03f23860c61ec494b97a573f4786a73b15f5cc555dc9496c15556d0c7021", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "d6af4b7d875e799fe36daabc078745379eb75152eec307d2c468d5c402e024fa", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "3de508a4e2e7ab31d9b8853312479e1c1f23faf126568ca2a5049c77fc273817", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--gl-trial-balance-02-1b649a914a": { @@ -92,11 +92,11 @@ "instruction.md": "3088bd2f3e1a68939a4b94c01bb9aa869af5cb1e7b0e2edde8a1e9badc8db07e", "solution/expected.json": "c5aa6e3e172ff0b94c2d45047347cdb47a9dae17e81fe903f29e2b399b4fff5c", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "d03e052ff970a1cd6d95b7f284477b6b5a871da0a84ac25097c226880068df8a", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "2c78edef6988ca7ca4ef4e9b18d35e7e142309551d80ca640aab607e6c7f0854", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "89d68bdd023dae2b8eed2c4a58a9bf15906efeb39c556d84702032f5ff8acd9e", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--grant-award-form-01-9f99cf9d0b": { @@ -109,11 +109,11 @@ "instruction.md": "ec6a203328d6ccdbb7d5496cfd71523f07b34ede99cac113fec18f910a042052", "solution/expected.json": "cff4eae9943721422da8896a83b86b5fbd3fba3a9fcfdcf43d8aa22b59233355", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "0464acb7a2ce139c75b9d5e1fe856841d9789a40d16a76fd3a7a9a96cdbbefb5", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "d5830ae754145807b2a05c42168f1fcebb7f460042c6b13b9d92d335dedddc6a", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "9150aff585a77ce7d387ecac4b95f6f4faa1d72aec86d8d509db5f95d12744ca", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--insurance-schedule-01-d09fbeff57": { @@ -126,11 +126,11 @@ "instruction.md": "15e57df4ba1d2df0eec0ad949cb7e90b7b07fdd591d4e0753d03889a66e075e3", "solution/expected.json": "45d1dcc3aa120f2d1049ffd426725ec978d740f69b36ce51bc46d6ee53b22627", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "e6ca6023f0e0a7faca2bfbd11a4abc4f0bbcbaf39cd8d66bc676bafdbf20bdea", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "4d5000ff9bb376ca96cc18a166a1b94be2df490140fbf97f2fb2c614a630b355", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "9b11142b61829102bde445ef8937a5813b29792615cf166e7a79909cb1caf9f6", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--investor-report-01-4eb56d214c": { @@ -143,11 +143,11 @@ "instruction.md": "a2f4dfe9c10377434a540602a5bab66de52d3f34955b65a89b7bbc87702a7238", "solution/expected.json": "8c40976c2417e3c2be5413c64440d3256940d898dd720e496e3daf79bba111dc", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "20ee86ad8650379c2efef9c3656a655efb0a378525287771e42cfaf5a26e2ced", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7d97adc86e3a22da6ff6f70b2d02a695e4b5bc19e3932276b3dced2c1a4a6826", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "342ac8fcc94f91482253c68bc6456b02824168aaf70feb187a0fc1e74ef093b7", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--loss-run-01-5186f1382f": { @@ -160,11 +160,11 @@ "instruction.md": "1f9e44e85c80f5a7235c102af832c1af21d8c4ff9eb31f5c12dc5c126639ccf3", "solution/expected.json": "a9e32b59123fad61dd880f7796e05efb327328d38d4f5305a9c62b64444332cc", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "3073701d6d602b92e75d8e3ae714ec24f70c330630c9fec3e50a02291b54dd10", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "f73a01b313c108d52af7362f6e3123d12951f079a565906fae99a41ba2c3b1bb", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "ae91530f3510e79e6f997669c721bbfde698f571b444ccbc8b9ef1758e169058", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--loss-run-02-06daebb84e": { @@ -177,11 +177,11 @@ "instruction.md": "1f9e44e85c80f5a7235c102af832c1af21d8c4ff9eb31f5c12dc5c126639ccf3", "solution/expected.json": "43472099d0ee6dd8971b85eecbce5ebf4937de3e73c7b77c4f09a302a21a6cab", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "bd1156eea066a828a7f52a8654779ae82afc65abf56a0e8a03edeca067d4d1e5", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "807c10dd14ef9193613fb75595b246cba66c6648c9a86b21d7f46b23eaa68aee", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "d49c0c2050538aadafbb4c3b1579ff8cc657f5b93b81bc91654f308368a8d7d3", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--mortgage-application-1003-01-223f497b34": { @@ -194,11 +194,11 @@ "instruction.md": "3fff9963e78a42e2c802dbb4309135e2f3fcfe6de23338895a066a640c7ace40", "solution/expected.json": "14eb13d26026228d18c37a48e48fd9585bf759e3be53a68394ed6973252134fd", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "d9561cf7c38cdada4ce21422dedab5c2a6140825fc986607d432979c84210c7f", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "d185457bd347774cbc101ead73bf81dedc8d3e441354f3945f05814ed6055847", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "15a16ac7e3f1ab403ea07165f1a22b62db662b3e0051a55e0f8333802d345b48", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--patient-record-01-d96494bdeb": { @@ -211,11 +211,11 @@ "instruction.md": "f4d1baeb760017382e9ef4421e2dd1e66a7f28f8b874f4108dc87fb217b16faf", "solution/expected.json": "25817b8653e9de74ac1c92b93b0d8e8374f826c4a5ab1f07f9efa66edf740a66", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "a87167b713783f1c69e9ded3547bc66a4669fb6c3b92090572e4e14a382716c1", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "04f2b892aba3d0c8c35adfac9c33457d40c8fe7e29043f99a6618ee182e51fc9", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "2ef073a039b47c8740d90aae2b83c9c16392fc9e45cde403e319ee9d2c26be8a", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--payment-remittance-01-8b2f95de82": { @@ -228,11 +228,11 @@ "instruction.md": "4efb7987c4f59e39bfa063bb376d7714f7a7179fab63b41c66ed7cdcf04f0895", "solution/expected.json": "24e517b83623ee167ee2ab9225b8e679128a88c38912b06701efddc4b01fcbea", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "4c5cee06df9d07f858b7fe28becf8f0b61c3b2d7fd94342525e1865cf4af9ed5", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "88176c2c724e842669eed824ff94b4feabc497bffda7ab674aec492881fd644f", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "774ed251b4f8e3f3ff68e993179ee606e0d44aa97948cf4f5c29f36177401ebc", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--payroll-audit-packet-01-82d20c9737": { @@ -245,11 +245,11 @@ "instruction.md": "ab579cca47d0cfb39910fa5603e2e7f777582eacf8a089dd34507993e39d03af", "solution/expected.json": "76b5e35b60faf47fceedd58fb143fc0433eb5ed94b2a0b0dc4dafae469bce950", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "3656f0bd86ca579ca7f65ffb638f96b9af568f8666ccec3a0f415599ddf64b4c", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b6fa1ff6eb10e2409cd4973fb565f5b4b11498305787b1944d3e8e663653b973", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "802c1ade47516db6d2bbc634e861346b6fd3958cfbb5d0fa75a2f109e4778cb3", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--property-bulletin-01-d9f7a0071d": { @@ -262,11 +262,11 @@ "instruction.md": "a76206cedb21c8827f06b106d3422db2b725d6cafa4345c41eef343d7349bd84", "solution/expected.json": "626b79b242468f218acff72a1d0e61cb9a725d298e30bcc3ebe4f34b29ae5d02", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "69476a34243629416ae824c4c93518dee7967d4aa8f38cca235411da8f9f781b", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "0b6d8a734dcb3626a298f71e7faf4c011703b7256650ee6bcde4f15e5a06905f", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "9e9e33a9af3e9c6daf3e690ea1838e176c258d7da7987a71e3211d06dafdfeb3", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--regulations-01-f0515332e7": { @@ -279,11 +279,11 @@ "instruction.md": "5c8bf7318f75d71d84ed2619f477b297e0a0622feadc656a6889d12f1acb07c3", "solution/expected.json": "716ef61c0c8181cc74cf4210eb1e6379829ec3a9f4727c32e5256f4def9097ae", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "8163b45b9e0144bcb005b033743d1eba1bca58c2060a087ae46411c25a16d10d", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "bced9dfa79255822e56cbbddb51ea6945ff96ae26c12ad6a7273c886b5702f48", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "df2ff46da2f069fadeb39a18779848cccced2ad61b42a91068c8318d5ec2ec9d", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--regulations-02-f7b2d65449": { @@ -296,11 +296,11 @@ "instruction.md": "5c8bf7318f75d71d84ed2619f477b297e0a0622feadc656a6889d12f1acb07c3", "solution/expected.json": "b410b75db5881c70f090bb2bb9e050d7670b6aebdc587ace0942858c82a77491", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "61036529d9778e72a7dfd997629a77bc3bf92c79bc919e2be717b40b358d95b9", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "546020322322c789300692c4927aa68e31d34549614b25d4238e34328e277e4b", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "3a5e46c66c249ec9c57f928091cbd3cb64608f4b29da78d3d66db2ba818f6743", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--sec-13f-report-01-577282a002": { @@ -313,11 +313,11 @@ "instruction.md": "31e37ebf61fcf13097f089f3280e3bfe4c3c218d30e0c3719a32e2511f8811d3", "solution/expected.json": "9d02cd5448005565d1f82ed31e4ce83e01ec69f4a5d0f43e4be77a9d92cf0424", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "97298285090ab35729a98552f8f97c65af654d113387450a738fa7c4ba998eab", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "49117a7a1cf2d69b1f87894f2fc1cf9f66e4c648e4ddbc7a86ab679b89a56b65", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1ff6cef743feb6ee75f855152ab1011c815869ad7aafd11b92ce08d1e205d445", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--ub04-claim-form-01-1251817721": { @@ -330,11 +330,11 @@ "instruction.md": "2a9fdcf1437b65bb648ad0c4a3820df1ac204d5f5a35b6be01b2f7d70e57c720", "solution/expected.json": "40289b6fc27a76b89ffbed1c1009a5f5e8ba28a79795be40c3007f90237b23b5", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "15fc6d66bfb1dda1ef735173e9ddf6c2f413401dcf4f4bb2bca21975cb3ee967", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "4e0b60b21a6d93b0d9c8442415c3c04203613523925ee13b18e7a00a4ea18019", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "dfcff01a9e82ec6024e2e107912dbd1afd4bd1b3ba20c96a94ca1dfa7d6d147c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--ucc-search-form-01-c81c96afb9": { @@ -347,11 +347,11 @@ "instruction.md": "3ea150f651e76452d1ddc4e748f23b938a6c0e85f52f3dc1b11621b743893175", "solution/expected.json": "30f65e684f30f06a494e50ac6275c9ca818683953d0b64d03ceae38eff011f66", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "1429bdc527935d1b5a63566cb8d75446a914c31356174a8d6688bec072dbe572", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "351a4816cab4ff28cb75c2a9b8a2ead3bf1ed78d8c0426b4e36b87bdd844cead", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "dbc1754519c580626b8091b7fa37f53f9a46883f0a5e021762cab5dd47a42924", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--utility-invoice-01-fc8a2801b6": { @@ -364,11 +364,11 @@ "instruction.md": "120e7090994cc24dc58ef338f40e5818d27a331ba26d6cc3ec0d7d24283d4c68", "solution/expected.json": "9c6b18f6360055259a913e786f9847d3c1a374a6fd2ea6a8ff2c8c645d1753aa", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "7e4b71d3b73fc2cb9a794607381d6bcca36c23a39241f7cbab25e799716b4a4b", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "40a9c47a01f6902d989df82e72ff01c58a9ee86da221ddb2a3af47d5c5682954", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "2502c6b1bbe22c4c1940c90674c2f8f0cc2e4f63cc74c4c1dbed4f283acdba4c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "document-conventions--utility-invoice-02-de65eb0697": { @@ -381,11 +381,11 @@ "instruction.md": "120e7090994cc24dc58ef338f40e5818d27a331ba26d6cc3ec0d7d24283d4c68", "solution/expected.json": "aa41e2cd42d70154bce58ebb0c64c25f2d18b11ffdf9f2fb93ed1b6196db7056", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "a000552b0b4bd5acf2ee45db5e07cd34aa00cec1526b80ccc652157aa967239f", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "0a1a2392d53b6926d83a7d6b583d8ec393b09ac5d44ec0953499454074c66369", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "94deeee36999b53807b9e892cf935b230c280921fba8b30d583417986c37f83c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--care-home-census-review-01-91658ecb4e": { @@ -398,11 +398,11 @@ "instruction.md": "fc6faf87039919d62f5264aaa451c235ea2bf11784f683626ef4713a8fae7eba", "solution/expected.json": "c9a923e582d2c933c325c8c98d093f79434ddc555b5463aa4664a3d34a779494", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "74b27bfb9ee8a8007e6c6e68e57f1f4011b382353c0d6c6d6c3bc58192bbb446", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "c34c74d118ad06f856902ee22f3b9805e416bcd606fc45da2b44e14126044882", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "d6c443f1c41019940475d876a6651736a3e0092f97b001ba1f3b928c6fe0df9d", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--circulation-audit-01-baf7e137c4": { @@ -415,11 +415,11 @@ "instruction.md": "31b4dfc8dd00fd2504458238cc7f6ba773e206ef12b73c42d31c326164984f84", "solution/expected.json": "a53e8076e6b0cd3a4bf5aeb8ec8a1158ffaa5e0e758038d42e697edab9d8cefe", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "178ca41c77a1f38c05f37392a4fdd8367bdadfb9cbfe8c270c5adacaf4dad059", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "46cebf7141cf1cdc79876e98820deee7b996e8b12080c796a7c8aef32db488f9", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "cf7868a2b0ec03c2b6fd324991ebdbe9e591885f66395e6885161db943a85098", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--demand-response-settlement-01-b4e75b045c": { @@ -432,11 +432,11 @@ "instruction.md": "f7f4d6f4ccd931e895326b8ce6dedae29843135f73547fa01c1916aa3b457d2c", "solution/expected.json": "d6a28b72dd2805afc6ccc121762257cd1150f90a3016f3d1b6e698bb6ef5db6f", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "d2a9cadd291d2d1b0ee4a9202311f462e61d510b0741040d3d7b4e908d3bbae8", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "6ba8fee03f0908f536011dd7f85ef3f3f7896ec46f7bcefad10c1018c1cc323a", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "a7cbf6d41e29453cb654146cb331c0a55d5befe19feff33c527595d681397c83", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--export-credit-policy-results-01-827e718a5c": { @@ -449,11 +449,11 @@ "instruction.md": "1d938b86aaa4231886f8712a9362a441d7762e3a21a70623a1cef9612d14284b", "solution/expected.json": "8fd0adc40134ff0bfaf97a0ee2de61bd720fc2214973dacf6ced4e063afb3bfc", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "0ce658aa20cc56bc8b9063f8894ab2b29290efc0a0c9f4d9000e6e8b761218bd", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "3d65b7e3c6fcf955bb2b02cf080e80a67b992eab1d7c1524e8977b7933756f5e", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "7489586926d737c831c8beb7513d3cb511f3603c054f4d3f7a181d5af350e525", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--hotel-room-block-review-01-6a489feb62": { @@ -466,11 +466,11 @@ "instruction.md": "bee9864af655b4e9ab8df7d11f0378d9e432cbb8e4034d439ecf7a4d5dd1b156", "solution/expected.json": "17eaa315fdede983477fe5fbd4fe4ba8bb03d0114c1bdf0713f5ce0af3b09a06", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "d21f6e5e93a19a3073135a6814a3de5e73b46b6ab43e0d36d55f99716b4adf1d", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7b43543e8f8863df3d8396feddb4d7f7e7967c3da2b5efcd0d115fd9bbafa0c1", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "4f44d05cd4f50a24fcf8722af322d091b446d2c55e7468964f0a2998a577eeca", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--import-duty-reconciliation-01-ab2e322239": { @@ -483,11 +483,11 @@ "instruction.md": "93f7368206526b11c2af9970d7ccb1e91d0f1ac77151818cc29176110cb762f7", "solution/expected.json": "8e3f7ef7be31c3c413bd81522743a03279c09cd3030ba0b9dd7d74903452a17c", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "6bfe260c03aa35ace89e0b3f85007451eaed85794f3fd8deae212fb8e7d410ae", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b30435ccfae6b50e4b5aaf57c0e75361a76afe1646ccee91a62932e5e6bfdc25", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "951808c795a7a92ced6934865b85621b2db1b86977546b569f968963ac8cf038", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--joint-interest-billing-review-01-fdea88b7e0": { @@ -500,11 +500,11 @@ "instruction.md": "7d28500112b6c33ecd48f6e574ec09438064eaf8a51e9262684b003ea96f0a82", "solution/expected.json": "9976e76092eced8734e81211e3ba55b5ceb03f7d7556cf2a20b26a7b7abb02f8", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "66013c2cd5dbff44afcb98a66d3493a8f2baea296643bee87915c8454b81e597", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "998a038d805fc7e1d8cfdecfd4d969a781b8b4cb542c4b5f0ba2b68bf9582bbf", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "f43c05b990f827b86402e557b539a43478ee3796aca60559b9f38f95718e82f1", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--lab-safety-review-01-7bac338a61": { @@ -517,11 +517,11 @@ "instruction.md": "f21d7aafb593c4fb5ee5a2bfe01252291da684313784a583d4f3554e0032c1d9", "solution/expected.json": "c27efe5b3326352228094cd8ab484c280a5f1fe6f98a6bbe464178849583bf59", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "28594f12779b2c9fd7e29d682df0e48f115e2577f4187eb6250cd8f10c242013", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b3e3ea04fd2e6fdb85bc3772cf169ae8c2a09b6e9ad9ededddec4a733cb3e33c", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "606c91cee376c0ec4cc2f823e07cb906bac93f51d229ec7cf5876d18928b7b01", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--purchase-contract-review-01-3cb1f19945": { @@ -534,11 +534,11 @@ "instruction.md": "65b1112473645f7a9c0d73ebbbb9d1e99d0aed173404b8253faba31d8c4e079d", "solution/expected.json": "d15b795ad64b80291d1749178e1831ee8c1316bcba040c6365626051597661cc", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "49fef8b1959916bd5536f9ecb0cc91816977ed4c4bcf2a4b47922cdbb54c5af3", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "3c8b1428d2b219497e99bd26e3ba68dbaa8b535e64c35ee5638de9b903e0b4ec", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "c9193b5f97a8f7e1495af1892d3f9fb419490c21468272c238af00bd11373881", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--school-enrollment-review-01-325e9dc90f": { @@ -551,11 +551,11 @@ "instruction.md": "3dea03fb677a6d7ba8c2800d1869e7d4e5f4101df62bbbefe856272ab5f42081", "solution/expected.json": "ad1ccb060ced61d9d6996149ba1ce9a113d0e04ea2a075409d07b3e33fe616ce", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "fd0e951ab0fcb3d92fb621294ec2fb4dc46bde73228226464170899efa2771f9", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "8e4a7e812d6fc8888007c46eed86f88c88e36bcb7ee990223291873c6ae43ac4", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1adb88b9a72b6e0b912171c809a5b48031747918f58a313d23e640a8e7b5468b", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--show-entry-check-01-51f2a49fd3": { @@ -568,11 +568,11 @@ "instruction.md": "5dbd78060bab4f1977e768a424a8b2481db2fdb4a485bd6ec40749177d5cd44a", "solution/expected.json": "740796894f23f96231a6d577b0b7dceba369dc096675d24941105bcbc5e2e5e7", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "022f61c20abbc98f077f23411e5ec41dbf2aeba87b7a35cc24163bdc2cd0d0aa", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "aedece664184eb7ae22d285bb26b89a57218426b1b6c535b23407ab4cb1e7fa1", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "d2883cf639d024476371e26ca56289a76dc416cfde14847cf080acf639b426d9", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--spread-betting-account-01-84013d8161": { @@ -585,11 +585,11 @@ "instruction.md": "8767cc09a8ec2b34ae2bc54669cf55ee564cf072e03d685881de98d73c29b1fb", "solution/expected.json": "49d8e1c44e7ba02635828ecd94363b405f06bc5bf724e8f8d6bacbc9f7428bcc", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "f2e852e6872caa16e0ffcfb499074e39b781f59395745b6b3f6b08141972125e", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "ba7854fe05e5b3a980793cb3c289f5fb6250ee46df45782ae319241805e16927", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "7c1fe49ce4f57d8a5d41bf8b9151c6967f272685a896d8392c44d7a6b157e0ed", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--subscription-seat-review-01-444b57cd9b": { @@ -602,11 +602,11 @@ "instruction.md": "d459e357cf446db3da669b2496f5827ceae8f01e6a5be93066d644b0fe53e919", "solution/expected.json": "30651e191f2bad165cf9e094d044fe23ff7769ab36a9650a72c44cda1ad47b82", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "7edd30baad31366944b76a40d0298921a088021322bb49c51a2a30fe3c8012d1", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "30fa7d1a7594d6493ad835defb41ae55c2bd0056c0e9037ca3a9b485a62b5af8", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "06ef8ff1b6fadde68171f3ed0cb8ed8835d3fda738d2afc29f3e3c7e3b4fc404", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-vocabulary--transit-ridership-review-01-c555e728cb": { @@ -619,11 +619,11 @@ "instruction.md": "4af7be4ce485c81b8894dc9d18c3705543e5d05a7d91faeef63dba5744eea75b", "solution/expected.json": "9d17b8c657ba65eeee14f60b941a373b610103ab698e4e4797e9ddfa94ae44c6", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "0eba027f1e5561bebf56d927ada90a55b4918e172138ee42a46c6cc15f4bbe87", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7418ebf69b32e7359004c437d340ba495418631f009b66c74724018605f2a6e9", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "86e1cdaf851a29ba6a6c0ac0876d9354ec8657e93f62c214f61c5de0f8d8724b", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--college-cohort-file-01-acc6b22631": { @@ -636,11 +636,11 @@ "instruction.md": "2f4c0a8f7595530acbe5d1583f63235ba104026ffd04269e1f99f135732f6c1a", "solution/expected.json": "3016fef7fe4626771c90ec65c13761d66a9f41cbf39c48e6dc0ee8aee6432f59", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "0f7a415812add89aed7e3ff35734baabbfbf7081aa69ea86c54287025d494de6", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "6c049fe5ae5e94b96a1726edd87023ca557d4d1edf45c7257a30bae9e3586b13", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "f17c4284d7bd7e7ac8c2e0ce2e03fd192782731ccb4cb633524bced0f9de7798", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--container-demurrage-claim-01-c28cd4183b": { @@ -653,11 +653,11 @@ "instruction.md": "287aaa4d258724ec76154ad9b9df40ed56060dc0b82802152ac15aad7fd05cb2", "solution/expected.json": "7e55faeb6d02df4792f2130413c203f70c9a93a2e26f7390799cc2f759a2b93b", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "227e807d9d9d999853683a768176c93a2c0327f82ef2a37dbee3bde559b91463", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "69a41443d49ad1b156ba16fd964953d5f22fcd3d91b7dee5974e5c4dd6c2cc7a", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "61ee1eff2a14c2bcee616159fa8c515063580195118a6a20665da5b4af9a34ed", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--election-canvass-binder-01-38b76c8225": { @@ -670,11 +670,11 @@ "instruction.md": "ffaa60ab37002c102591599dfc3dce04a3c3f431841a66bd4cee45d81ce0ed3c", "solution/expected.json": "69d76c3338be11d537c9d33932176bc19c22b731674cf3e013625703d31a60bd", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "e3460df467754e3c5a07ce8b2551893c5f6d870dd2cf61efb65ea7300eb2721e", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "68a32d1ccad51d2c7084015d07a6d21bef67ba0dd67607ebc1efd4b5536b5e56", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "c4600f1953600fdcc717d276a212f75798b9e327fa94ef7a55ebf8b4dec1174d", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--engine-utilisation-return-01-0161f8f230": { @@ -687,11 +687,11 @@ "instruction.md": "274782bbfcf70637c6be0599eed2f37eecd850f277bb06d7dfb6e32eaa323cf1", "solution/expected.json": "7ac659bd0c5712768e3363f2f317d96c5d4feae936fb8405bf40401c94800301", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "132b6511a251cbdbc5108fe92875b631f0d98451f3bf8726bb6ccb5d95479d50", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "eafe190dc9e3901b4f422f3deb5f664c666349c3267825ff076d5e43669144c6", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "847e848f7ebd4410d38fc59b6f466378ad7681c804b7b7f59a738aa2a2a5ceec", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--franchise-royalty-report-01-2cc1afb849": { @@ -704,11 +704,11 @@ "instruction.md": "3a229659594eeaded17df2cf2b75cf3c1a388c9aae7997071759b2893315a8ce", "solution/expected.json": "b0915f2d9d58baee43156f92ea4fed09675bdfa028d8938094be35a4a1853c5d", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "d96eb8606b0cdd6cad5943e053802a2b17d8e9c26602af299ac8a23e3ec0fd6d", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b7e3f9831f13385ec5588226f72a74259bdf17d046525c6cf7d1ea007ebc8e8c", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1a869ed03791b65d8022b3f9eac9418e133cbbc8078b7dc3d6f224a0096af556", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--landfill-diversion-return-01-01b7a7f4d1": { @@ -721,11 +721,11 @@ "instruction.md": "cd3a048290e21e94b2071db22d4c1d04119179c078498819bedb12092bf76fad", "solution/expected.json": "0faa108ad11fc33f6d89ab648ca93f81700b3826245ea6a2f1094913b45de9ed", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "ea1a490c34f61dee9b7ccb4f0370d6a22326917910d7cd0b09bc032435267ef6", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b6469e5aecb5f1ce7033278daabef25f3d222751358395725e7bb8f780f4a302", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "96b0f9f9c0e30fc90c3967eed02bb8e82d1f52de54f70dd3c3d916143e87f507", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--library-aid-claim-01-86213ded48": { @@ -738,11 +738,11 @@ "instruction.md": "314e1448b32f4516acb2507d3425170d5bee5c8c9e255db09c49cbc601afab08", "solution/expected.json": "b63c8e9b07385988a81fdbba33089843ec3471951f9942008a60dc82bbd8afff", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "25a45d2b889a70c46c2d885bf5579fed4e0c2a7abd0b4daee0c4888e964f61a6", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b3175abcb5dbdf2d5878a51d40446344bbb94e7e200204b03b8683cf5524c7cc", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "b8dde3abdbd4f1cad834401b7e3b5e84a29cdcd07416cbc1002c348b3e0da78b", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--mortgage-servicing-report-01-7bbb926cfc": { @@ -755,11 +755,11 @@ "instruction.md": "e12a14c02c5eae2d4b98f5fab0b587a70feba64b93f2853e89327242d4b8e014", "solution/expected.json": "a1314869f8d4fa2cf6da0cd453f3738ff0555e8c5507bd664a83a4963e3397d0", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "88293653548f171648acdbdc46d8a6889d1896ce834e60855059968e0aa9f019", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "927920eab6f4093dd18822d6e50dfa25b30c59fa5c96a9752330021ba3ef0837", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1cdc059027fab946ed11dfe61dbfb8d9d1a3189156b9148031b897ce6644461c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--premium-audit-worksheet-01-d643f66576": { @@ -772,11 +772,11 @@ "instruction.md": "8099f5e239dd60fc9eb0b5c1c992724c4ceb6572354256dd6f174047299c9d27", "solution/expected.json": "26356c7ac1e3fb74dae1a38e2edbe9ac2cb99f83d991d0714c75bf8581b11887", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "44df6708d80eb3838c3f3c4422efdfb0b47d064bdd07ed370d5b371168d5c47a", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "203ba6b593fb36f6146a9d8cdce9f6ecd64af6e94c6dda84f6bb7f0a9dad7a81", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "0c3a4a00f6102790b56bc77ae2ed75e5054793513c7995c8dc8f17cfcb5a9ed6", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--travel-expense-binder-01-0be1c101d6": { @@ -789,11 +789,11 @@ "instruction.md": "36356bd2d5725077e56a4f9fa8e93d43a58e7280d95397ea2973e4d8f086e3bf", "solution/expected.json": "90c27684a62b36dd14ca5d6142cf13b0d4b7bc2d00e7624fb38bbe70aa0d32e9", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "89db9a6239ad7a67c99cea6befd03aaff41d8608d409cad094844c81caf21af5", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "e7942fe0f66842d97518133f825dc70180bbb05c8246e1a62203a51bd2bab532", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "bfac711928006811c0a61feafced3445321dab05f769dc49f02c32474e40b02c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--tv-post-buy-affidavit-01-ee2482f807": { @@ -806,11 +806,11 @@ "instruction.md": "94fc17eafb1eaa44e6c4f78bfa4ba314e368a22dea819152f18638bc2e60b66f", "solution/expected.json": "4b50ef7e89e170f1d778dd1d1ec6398b5688b79b1e0b83d344b4eb13e4192d1f", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "6549990da474d3f3050079f5c5096c9017369b23bfa5653da7c73d5a2fd5dd67", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "3dfde6b84dbc3471d60188d08461121b704a43253255847b793a5eb1ce8a2cb1", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "e45ea80e492ccc97f9a27b303aeab4f8aba5053f264c4a757c11e62a09fb0b0d", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c": { @@ -823,11 +823,11 @@ "instruction.md": "1b3ee4549a8867f57a9649c85d76b1d7937eeca8a02dcab15388648b1f344c7e", "solution/expected.json": "091579cadb71384d22e53ac96b4a18bfc1ab9724990a3e308c8147d009d3cad2", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "4d0c19daba3af8c121ffa414a50e1aab14e284f8dd1243f5751670f09eff5160", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "6edf84b91d2451ad739ad97f23d773383764b4b54fd3a1cdf7cb9ecb866594fb", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "7d09645c7146a4cc8d5df0e3d4bc0553144f991f49ea61b5f2d00ed5ca83ab65", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--audit-findings-report-01-fd21326b37": { @@ -840,11 +840,11 @@ "instruction.md": "d7a9ef24063be919a2163bde504f2cd3a39f7b48e37972f3ba5ffb6b9d62ec28", "solution/expected.json": "6b2684b0b7ea8a57e4bd9a40fdf81d0e392beaee2458ccdfede639d1f3bd5e91", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "bf54c452ac5da69f2b15b04dc81468b51a0e7a90606c823b330f11f55865b517", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "50894d3a3f4d2c08c435e01e91fa27039d54a28c658bcd3b8174350332874686", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "aa30cc7bb66f9a2c496bc34fe5b7e437ab8695b72ddb8f6f4a3d80bb8beb7748", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--capital-call-notice-01-150bb5fa8d": { @@ -857,11 +857,11 @@ "instruction.md": "4f607503f6ef9da1046feac6b40b51122edf2d0f8fe8f369db667ad2e2f25af5", "solution/expected.json": "a24e21addaaa6dca31cf3caae92ab0345e08cff2e3385913b6304ddc59c5f355", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "e979cee829b43846135c0011656bc0848056b6370ebee79651da2763161d9ee0", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "193e04e115d9b6f3511aa81331e982512405bfcaeb76d743b1ed18bb75fb1451", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "fa6578072b3e085f935b0aa516c972ca8e806dfbff3a8bf4f6d00cc27916e0fe", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--credit-facility-binder-01-898ff3eb10": { @@ -874,11 +874,11 @@ "instruction.md": "8eb7367790041d9cebf89b42bd368155370d368d7e7541ba5eaa77c712d1bc6c", "solution/expected.json": "84c06d7b3645a1a4ac866b53ba9cdabf7c7ddbce18955b25bd9aba7c78703c69", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "94e159f2def36503710e444396e21a7b4f3afed9f18890a5a7c5376b1a10b8ad", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "c6ae1c9a23aeb01937e7fef42c55b0ee5c1c665541d240a54408872b88c355c9", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "368d6802c6c5075ce3cc5e5a0206e0832a54a1456991847a088118e38631819c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--credit-facility-binder-02-19b22c187a": { @@ -891,11 +891,11 @@ "instruction.md": "5ebb3bdb7652790e043860ed99d994d4266af72dc3e9c402c527802775215878", "solution/expected.json": "c9a768620c32835091e90685e1bb46434fa516fe14d80eed5748a962dada3bec", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "e55736657d9ae9c684ed047eed5e9a655dbc3e1f0131e5a99df8d42c4cedfec5", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "28509fcd1d421b9622c0ca7ad8b410f1b36f37fe3633168d7ae35021ec6cf2e5", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "286e7ca0571b45fdced58637117c32cadb70b3edb4681b4cff61bd85d40be24a", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--fibre-splice-record-01-f48117ae51": { @@ -908,11 +908,11 @@ "instruction.md": "54c91a42a42d13ea2e33807522117f8af652376e106a3af3cd25daa97c7a0027", "solution/expected.json": "19087f55090088a5c59fc273b67fa2cd5e37e65bf4c5ae29ad6425657ba11228", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "bb5e438eacfdf4892e89a649e14b0e15f7df7528dab66127ebbf7de3d45aaae4", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "1f6d6ae8f5ab10d1062f57147a241f3c94e95caad4179eee42323c80d4a63279", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "e34dd38198368761aaab620a01ee8d43906ddc9d5fa145ddc2ce4872c21c356d", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--fund-structure-file-01-5d1a8e7039": { @@ -925,11 +925,11 @@ "instruction.md": "151e2c1fbe9c4bab8659b1c5846da28f63e928181d48c19509784eb04280e950", "solution/expected.json": "6ef0d7fdb0c93a86b81cad90c4b82b596d23ee8189830998bf4678f110aff809", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "fde1309daa2daddab21359d70e57473e8de2a4a3feae06aae06922bb196cdc95", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "3c63d481ff625143bc3713af92f2ade7d0710c4d561c785c00972bd1b942a80f", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "94445dbdd9037e81aaa16471df5eae0312630c4e695a4ea33ee542814a66b671", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--fund-structure-file-02-fae5e4fa30": { @@ -942,11 +942,11 @@ "instruction.md": "eeceec177560c30e92211aba54527aedd7dcb67702c036d6af3fd6fab38a9f27", "solution/expected.json": "cfaafa6970192292140db5af40b5f81c715319f392239f166eaf0e7af160fb53", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "b737644af3f908c86af5f0c95f18d8c9ea15cc84928c3f72bfe1ba030c4fedb9", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "60d1e362e0de35ceda1e972006c8c1df90e26fbf872706cc1d779aa0785338d9", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "e791f54bc7dec3f27aff0a41c3605870f414f313e2aec44de046aea51febd37c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--hvac-balancing-report-01-42b2bc9260": { @@ -959,11 +959,11 @@ "instruction.md": "028d59ab11254f727690de98214255856c64ef0e0090a4e591c147e9bbcfc338", "solution/expected.json": "b343468b38edfb5094322790ae47223bb73942f317b509de704a6f387e1581b2", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "8498d345a15a305ecef415d7d1fe418a0e638667286cec1bd06041b91e782478", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "3eb324fa2b3aa3f71849bfd37681b6ad173345164fb67838b7f6ceab00e4fb44", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "14035b0e6b56e262757931738cc39c65f7b5af188fbf34fb94e5cd28d612e396", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--hvac-balancing-report-02-d986d6e9f4": { @@ -976,11 +976,11 @@ "instruction.md": "bb3e82153ef56d21fb382a6aaa54313f9f63bee8aa2a4eb0ff900495dcb56bb8", "solution/expected.json": "056ecf4e6f6f6eeff9eb3df953edac72f2b716a8c3a85429883ba04396aa560d", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "9e588f3628c3d820f92814aad6314c9888c47c8a032813fad2ea7b0f303bc653", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "ad14362a0cd4c99d96dd6ee8efb41d5f5a549468844575e571cb0b1725014fb4", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "9a20c00f2f0ca26253294e51e3183d13110b8f5dc27852d9429419dc410d464c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--insurance-programme-file-01-d62ce4f3d0": { @@ -993,11 +993,11 @@ "instruction.md": "c37d671da898466ad979f9c3c20701c734b592cad112a9d8fa483d0f4bd6f490", "solution/expected.json": "0e46981481a2d1767e14cab39003db67b4a87c7696672efd808f2b5df9a5c31e", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "a3140385724fc93caa658ae95a99372963caee067752d64d84a7ab4434f23d99", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b6b26e3ca67c31cc5e5eccf858c2545aed34cad14f431a78443ae81c255ab83e", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "f81a47acb6806b4b1e35f772db4f90dddbd0bfd3263ff029535ed30816a18c98", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--insurance-programme-file-02-7ecb036814": { @@ -1010,11 +1010,11 @@ "instruction.md": "bafd0d642a8c1ab70ba6e0b696dd6ee6b0f2b79303d2cf368dbc7fda0536765d", "solution/expected.json": "ea4b20d93d0d7f535ca60226049ad811a3dc10de6e168c6f8bd68e70d71ff26e", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "7fbe313b5a7dbbaddc665823f7e5cb9e4f4aad34a2b943555eee7cfec5bf61f1", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "0210409ea496bfedcd39a4201cef31b4a0378c41fb7e45b550900c5c9e7a32dc", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1838f1fd66a285d1adb2aa95540c803ade10026d9f3bb6a08ccc4b36eeacea37", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--network-change-request-01-59bb1d126e": { @@ -1027,11 +1027,11 @@ "instruction.md": "a43c6048a7d843ca114843c67d5f6a487b8ee7ef605280edaf4ecb6d7e79f58c", "solution/expected.json": "616507b0c9b8de7ab040907ba5d631fe17a0a6b3468becad0a5cc4ad9c1ec19f", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "a5eb811dcaecb1a5c0c11e15f041cb883eee3aa6cecbd1cd6bf66495bd1ef394", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "8920f38127393b07193b40c999605f820492e7b5fc530e69d08167d6934aa870", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "6d7bb0519f27671fc984094eb137fdf7eb1d081a0e1f0d719f92e5acf68f9fdd", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--network-change-request-02-d6a581e913": { @@ -1044,11 +1044,11 @@ "instruction.md": "a43c6048a7d843ca114843c67d5f6a487b8ee7ef605280edaf4ecb6d7e79f58c", "solution/expected.json": "6e9d22c6a10a8f0619e45dacd3aa880599bdf70e5a9e4600eb76186a0fefe916", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "0ef9179f81ad9d495ac9ca640614021c10eb3e4a7527aa62e76981810d2b8efb", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "955b47d92841926f1cb967ca43da2dedd8902336b6cbdc4a3f7a8b61c9180db6", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "585298fce83fd1e952f0913b222c194d2897a9b8d11e996f0615f3e7820d2509", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--one-line-commissioning-binder-01-fd8ba37089": { @@ -1061,11 +1061,11 @@ "instruction.md": "03e473e3ffb3e79965f32921508c4ed5c0aea90b03174002e0ac9bb97900162e", "solution/expected.json": "e1f51f45d0cad377f57077acaac557b954e33b957a226b8abd4d97f5300c3e43", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "a47b543ac341ea9c1698af0921b144f490a5e2a9c900feaf23a0c3426eff7f82", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "f13d080dbec61bdd157ade4c632f5c8493a7eabdb80170939238295fa8a2e968", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "b2df253117e789c99c7ab588eb77dd8ba8f655d98c53f8abb7cb0587b12c4bfc", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--one-line-commissioning-binder-02-a4e599abe8": { @@ -1078,11 +1078,11 @@ "instruction.md": "59f4d8d146255bc4560bd5f24f66248941371dc7f4b07064afcaff5f560aa737", "solution/expected.json": "a9257d69891d5ad1c18ab1a8346be5a202c66ae33c716668f8cc601163f3c131", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "9941f1013a91a0b24523ddfbedf691623239267a4609472387d8e3d3baead3d5", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "b32dd9e737a1343d9530a3b5ef34959eb41012ce93606025eb7fe1ff1d5fb716", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "d6af8a944d0a6b7a96b284fa51318bec7620619c110fe6a81ee1cdd6cd5fc9c9", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--probate-court-file-01-f41ffed757": { @@ -1095,11 +1095,11 @@ "instruction.md": "f1d0a90893962e39dc1c48eb1a7d46c278f15723d697cb6682248722cbe37e7b", "solution/expected.json": "2b1990b83a76843449df28d30ff5e30e3da62c1d9fc9b614e3a2da2d5eb84c88", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "e0b1fd2089c8fac92e6b901e6bc038fac85fcdc14e40d2d9dae3117367ada964", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "15e4ed7589432fec85afc55565f400492d9412fffeafb01717c80c4dc5342651", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "3aa836aa234ca1498eead0eb529e5fc89c2d89fb6cf924521ea311071bf9ae7c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--procurement-audit-pack-01-74e76ae05d": { @@ -1112,11 +1112,11 @@ "instruction.md": "048a87b15e77f44d0b106c96fdca60c0d6a9823cac98b5c6680b9a780fed89f4", "solution/expected.json": "3364b839ce3ddec9d46a2971561fc6483f811de56b83b8b6bc73cf369a2d64af", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "00677b49a7ecad4e7155ce06097ef57a9c426dcedf840b5a2ccf338f0cab8bdc", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "1bee440d298d3262deeda3d8bd9cef2fb5a388d67a09f553ed15484fb79c8b2c", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "b2baabc0debfe970decc4b7f6f016f2f1eae46cebdcfeaea857bf4cfa8391796", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--tournament-results-pack-01-a03e7b61ef": { @@ -1129,11 +1129,11 @@ "instruction.md": "75b061f64fd727c73ff8e51e631525900f8194c44ea86f478f66e19de52c1fde", "solution/expected.json": "f63bfbe571a9cdad00fc583db87521a1208b5f32ec9da5dbb049e7e78284766d", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "b91852c44393ef08f68ca1dc2d46bc6c8fae1a65b1421a6a687c5016de766823", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "e97fa0e2ea7b12d3ed68628541adbd0557efe329d01bdfa20e4b74c6918eee24", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "8538e3d6f1bb6459f171d113592423b9edc1b36217fadb80ebfef4265355d7cb", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--water-loss-audit-01-5a91bf77f1": { @@ -1146,11 +1146,11 @@ "instruction.md": "1b51878f310da878dfcf0f329155f79d937fafe635beb2f289283b7a6cec662f", "solution/expected.json": "e1517e7b1f8ac89ab3b8c1757c3f7edd142eba4080eebc25726417484a4dea07", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "81e07ef888cfa7896b478b881880390e0703d35cf78459532b6f35fba6e93a40", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "546914a7552812b5c250a089122d064b7106c54d4f5d77c1a1b2da8d533fdd46", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "5e43bea6856a3643969269ea6248aa90fc47e280ec653b335a5b16f07376aae3", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "drawn-relations--water-loss-audit-02-9fee656174": { @@ -1163,11 +1163,11 @@ "instruction.md": "027c046eb5f1858911d9d82d3505966b9866974654bf8ed6e871d51386218bae", "solution/expected.json": "aa1e46b791ccde39a684d30a10d4b93843e65b8346ae0b30c3aeee08ae47fcc2", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "c4003f58457d3ec6e3a1da7862e05c2fce6a7cfd15c844eec5514fae825d460a", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "4534ea804e7de593da1b21ea92381a257666abdb0cdf14be55d026d5002abd57", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "fc74b5458499566ca6824555c1e827bdd21982df5d806669f60e9ffefa551423", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3": { @@ -1180,11 +1180,11 @@ "instruction.md": "ebf8e56869844cb9e8edbd9dfc74257048d5ef3f0a888d2b9571f08055a70aaf", "solution/expected.json": "4450a3a9bf168502dada8a99a10d6ead725cc3d92939e1b9fc08d560efc9bb6a", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "4f797e8fa6843bf3a6af3922d5c597f5509109b9e964bbd4f7d9d4494dcf8a7c", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "3005b19a292692076b879b3445642d8ab529b462d3b9ee0df0b0c0869fdc077a", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "3ba8332b66deb61e1904cdaca64c5cdeca34d7107df52286d300dd7a44ade2a2", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa": { @@ -1197,11 +1197,11 @@ "instruction.md": "a1bb3ab9f0db0bd1bef512b68691e72f60023e19ca815e2bfd02f3fffe2d17cd", "solution/expected.json": "54b6c9a1ba596972c312eb2fcd803dace9917e9bb67a5a640b56551691b25823", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "692290feccf67d9a1d6f3583f285a655799927eb0bd60b38f012f26220a01b02", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "2294ce703d2930db4e4dba16df865f2f34e3bc8702ed08dc58e165c2031ea468", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "e6abfbfb1e56c33658a0146155b68a5b46fc35a65fa4a22674bf3337b711d5b9", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--assessment-billing-run-01-a758923341": { @@ -1214,11 +1214,11 @@ "instruction.md": "6bf91bc8b83e223779bc1fe7d8a7e3a260d9f48aa3505d15391815a5cd90df40", "solution/expected.json": "bdba7f9aa90b838a47d51905e5fb40df4322be01da9c6c150a4698b63349748d", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "6cb8e4899a220fa27a308e2d2b38d15898cee24fb209f7e3b5e395f5910a0434", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "99d1df28775e47a96336da209ed967e0f057c1515fe21186a38eed84201842fe", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1564b95e95b8bfc9eec11217e53341e866b064c09bde83a64765c7a90eb15f8d", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--capacity-change-pack-01-426d0e3de2": { @@ -1231,11 +1231,11 @@ "instruction.md": "47095f182a52ca4897d8b1c79d14c1912a58cb00201f4db8bd54b74aacc83b02", "solution/expected.json": "43dc5fd3da60022587bcb4c871326dafd8824906ed19024b28d568575d271776", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "45d13571739ede8d9ebbdda5752cc05f247c12ffcc15bb919474c0edaa4d7a20", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "6f1fd57e88a390e2de81ce2d8c7554a91a7ba6b5f01849593d75b139b893f3dd", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "30c32315162217a1261aa8e6174f7d01191ddf33c294f3c3693152ea08db82c2", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--chemo-verification-01-755808e636": { @@ -1248,11 +1248,11 @@ "instruction.md": "5c5abcbd5ba866d8ba73a22a197377893a512c60829dcc5822df3ea377d671cc", "solution/expected.json": "735d248a96737013520ba36daaaf94da52c87efc533d3f22569e828c6e1560ed", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "dfe32ca60d1e79c27f16a1afd12d13f6348e56b0a566af035f0fee2575497828", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "da36183ae6aba51e8a1ac3af93bf56bda28cf6188d6780fe09fb02d5f17fdbb7", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "ad73d44b01397fcb52f80910e8f813f0354a32635ec03c5ccd10939874d7aca8", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--claims-triage-bundle-01-6e0e405433": { @@ -1265,11 +1265,11 @@ "instruction.md": "f75c45ebae1df31e01049bdaa5f60027f2d40f32059113a0307844100d855047", "solution/expected.json": "c6eff2a3b7664988d553b893f36e200e530afe7cf139b2ea4647ff78bb42f2a7", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "9f9ae8456eff5d984bf698820b316b6224cadae9ae5f0e231d8d33a465468e89", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "9b3a1d256edcd76611b33f89d1835c7875741bcfd2028e6a0c975d4b8e060b80", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "cfd7751847fd8efd8fb39b0b24a96f2ae4a4a257e22e2524580e7a7c7ffa5a2a", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--contractor-dispute-binder-01-62110b282f": { @@ -1282,11 +1282,11 @@ "instruction.md": "8bc5eb0c516bb5f4bef775886a5dff3093891c4ffa6e751baaa839edf48b8921", "solution/expected.json": "9f71294c276ea29da5f095c0042ac0bbdbd4eb9b89c14590369e5cf32d5a8b18", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "1c23dc5f9eb49756526a27afda32712cd47a686a9ed0a0a8e221d85567877d94", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "1a31f988bdfcfc088323bc3912c970b26f8762f4c4da9bd6a2cd2feae9dadf36", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "89f45cd24cbe80f8a364ac6de279fcc91c3574c40ac055ec311775d2c17e5073", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--dam-operations-report-01-dec2676e78": { @@ -1299,11 +1299,11 @@ "instruction.md": "a3c8b976d9459f591ee12396f74183738bdfa5cf54a7db87065d66a2fca64f28", "solution/expected.json": "a286bac2ee50981fe6f9086ce23463b6d565c6cad4e0fc9aab8e63b4199f06d4", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "6fd25b44a613a1a1d4f204733a5a4f552d48d888abc5bbb3d508ab1bf652876f", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "fa4be8783936c743efcb3eae42b6cd45005e1cde6bdcdb5fd9ab5a1bdfef3f66", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1bb3a87fb36d1107afa57d8738ebb1eb74dfa1b4b57b3ca2a07212a7d7373fcf", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--drilling-report-bundle-01-9ba0552503": { @@ -1316,11 +1316,11 @@ "instruction.md": "6f4c71ae10e65dfe68bfb941517bb67e3cbdf2b0d80b0b7663a9dbc2ab867802", "solution/expected.json": "3d34218fc56ac23895ee7d598d348b3a529bd2c4ae13f2a6cc81a4d632db50b9", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "9b9e8edb248007654b86fc86c3843f431a6ac3a2bde15f4db5e97783ea6b5709", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "219f437cf7295e585db7aac8c9b6d8282143ba372062bc5c24b72539c9043147", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "fca18ee880a513ed477209eac3c960e9fba64cc823804873f96e58569c15db2a", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1": { @@ -1333,11 +1333,11 @@ "instruction.md": "742e9cbb903a011b87e6f50550a7f4fc678735d363e034dddb833dee230a56aa", "solution/expected.json": "b0c2ec1555b34c3f216b2a7ea39d90cb43844d63e77a46f244bef95f9ae00297", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "5d1f03af7ac49998e7e266ba849bfd819117f9633adea10b007b82f50ee7ec36", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "6d3490c0fe485690fa5bd6cfbc2b7bd20ee8de19069af3e115e9decfbb6650b9", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "935270487051c4232a42bfa32eb80bd7995bc162eb982281323a4e8b97b64cf9", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--eligibility-appeals-file-01-220e0e6b43": { @@ -1350,11 +1350,11 @@ "instruction.md": "300b9f0744959249602bdaaab08b6549b1e680401ca80646a4810ab58f6c4258", "solution/expected.json": "ec2d4f7e768807f95259d3b7cf7a1433037c2e269bf80ce2b0f21515a1d46b6e", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "ad403a1fe97eabee0319d9137b3c3e33ee8e82a0f2c49367e91862b4a4875a74", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "8bd3a842a7350c25888f7645c721841d0ea5bc30142562822e0ca37b6c9bb606", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "433bd72cfde007c4115988434256a08da10ee974091eede5d6b1d82ecf4e770a", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--gantt-schedule-board-01-824296e2a8": { @@ -1367,11 +1367,11 @@ "instruction.md": "debf3c4719e39be3f5f3a222b1ed580907dc5a7fae75fdcb31b298a85bd7c2de", "solution/expected.json": "f78df5b98ea207022a77d41aa267a49a3df811cdac4304bd8b5944e654809b2b", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "dc4175e274e84ae22293e5902cb3f718fa63cc18ad4f1b14f5fce70f7a92a567", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "8024c6ee0f77f2c2de85a9282f4ac2e0d846a690d2df1e0a91e141d6a850e506", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "49e13757422f4d75026f7ffa8c22a60f6cc6fe99c6401fcbcf2c8815cde24470", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--integrity-filing-annex-01-5eab6bac71": { @@ -1384,11 +1384,11 @@ "instruction.md": "e5b1f023594e7394293add3a7d646231bc5914782752d2bebebfcb05f3915371", "solution/expected.json": "88f22127374b8d2732f0a3e4d62e262b45e7e667edf52884e1511834a7d9019f", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "f62109469b1e9d45b2a2ca579edaaa620c675763dfe39d3dd57cc9bad112c895", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7547aefdb2ce2c5e1c88e409880820174a12d592e30c19f0f40811d5cddc8162", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "4b5144e590fe588978716a6e6167b73c5dd32183790063e16762a8029c3f5f2e", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a": { @@ -1401,11 +1401,11 @@ "instruction.md": "538fa729c4b961485dd1b8207eaef1c05a0b73d2e46af4436d9de804ced56b4f", "solution/expected.json": "1c21c5d81b518e7d6e61d43786f8cca9e801a151a9f0e032c6c51367b1d11fab", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "a465d3fc84edcbf5467991a64ec914da498bf84375bec9f63b66358aba687456", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "cd6a7aaf8a1c7d96fb985e7dea8b1cf0af654ed738b728c2c961fe308ffa39a0", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "7288b9b0cb97de55c6211029e4d7159f8720ca449e95cb9f2402da5b66b282fa", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--parking-variance-hearing-01-57fcc48058": { @@ -1418,11 +1418,11 @@ "instruction.md": "db2cfebafbb81b9e34e625640aac838f621c3f7f1030e43ae442a6974cab2a33", "solution/expected.json": "b4f9842e723aab03e908624795888c74911b1f2ec215f31cf415adb70d078f70", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "7828b20cb1052e3cf96a62babd6e98c80a9da5ae76ce5aa5c09513c494b913fc", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "420a57084807f9dacbd946888b3b05ef1a52bf1c0350be6166ce0aba5c9be1dd", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "21df7794c731318aac493f15181884a896acb7d850d1dbdc58fdd0dc3dd39300", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf": { @@ -1435,11 +1435,11 @@ "instruction.md": "e9228d0338561352914566e11e2c45ccbdb9837f9a2cb1b599d38472c7b6d4be", "solution/expected.json": "2525d2fca742d2dd8757b468518c504a2238f90b00a2fd4163c71842329cd7c1", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "24964acbbc309faedcf8f27c4fcba18b2228b34bf53fe520d94281846b4da5a9", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "08f95e8932c53272cdd655f4dd63b8b77a0ec0d429b4d889b485fca09f262436", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "759b0a757efa6a7053e9cb39516729fde576161f1d53642034c386859b54e8ac", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--pump-station-calculation-01-a0afde405c": { @@ -1452,11 +1452,11 @@ "instruction.md": "5ea50c3014f37d44307eb2e71cb51608309456c64f2e08e0387b0573b21b39f7", "solution/expected.json": "4fede6b1bef78eab60e53ac6f6af424e79a60f1dd2dd08ce2741e6cf754161d8", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "9770ea9178bd78579370bb266cc8f6adf17385534607d66c21f2a463bdf04eb7", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "d52a4059c9f15693e7c0e19b6bd2b13d7c9e835d20a8deacf88232b60098a14e", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "289b0cd0a8c51a0abf4760d7c82468b6419788e975a553d02a6989e36b65b332", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--qt-audit-bulletin-01-6dedae178d": { @@ -1469,11 +1469,11 @@ "instruction.md": "9934d7c28e091bd898daf8229edefecb09c62304105cbb6e1237bbef5707b228", "solution/expected.json": "6b43ad01a1eb271f52ab2718f85e9cf98189c6be3acbf171e27ef08a23dd91dd", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "72910ab3b741ae771ea5fca3633b43742186b5dd191d8784c4f0d3a8081567a5", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "171b4755d8f4d11dce9e11aac166e56831ee58acb03c66199c8d795c4a8a74ad", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "9b459b7979e36012180b205452cdc2964c5529d9a99a25e1efe2fea88e8decf9", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--rezoning-notice-packet-01-6c316f7570": { @@ -1486,11 +1486,11 @@ "instruction.md": "26fe27430898fd6cad910a2f43085b1b233ea6bfcab6a46ef3360a58292ccfec", "solution/expected.json": "99977489c9847e7d544e01f6a3ab9ff58f1ab207756382661292ca19a7873941", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "3b19a3ddd3c7d9e5dba9d6f76d6323fabfe4926398d90f246cca8b6ee1b7aba8", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "8d6942893410bf8f3f544e583cd35834dd1a839fe967e7a5d634a3591d0bb585", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "26dcaadac5525178db137864a966f127775c5c6a80d9381d09692a6d192db0b9", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f": { @@ -1503,11 +1503,11 @@ "instruction.md": "02c4c7c8ab5b46473710d68ed0c3cd9c60008855c3a24d12e896e9884f3c0270", "solution/expected.json": "9dd879503c6cb250a32cd336483801463209f6560af405dc129690eafbd6bbd2", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "168ef9c558a6df2043cc13edb6e9d4e4c263834e18a16402de128270c79219de", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7e6758aac74fd6bff411d49e5dbd8daba4a309e92d0b7b248b967126d4cf9f06", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "52a22b3d96839d7e204cd3f622eae8b48ad334b850794fd7357dab54b308b9e8", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--site-plan-review-01-09b2228232": { @@ -1520,11 +1520,11 @@ "instruction.md": "f9f042e9465cb65c1f768a10cf92347fd67f0d76067df0b4fa97c35b2566f783", "solution/expected.json": "521d10ad279232fc1ffd4e86a98701b3f593a9ae1bff0ee8a6bc47d28289e344", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "fe0bc34c202502e79ce834cb39c6e6a61ca36216598e515bc7412c11367cb80f", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "e313296c004519af384fe2f28f3bdd594a2002f1fc302104fcb7276a25ecccc3", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "633c05182cf07466b07ef7ea251b847638f5a1ed2a433d73eef80d12103470aa", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--stock-declaration-file-01-328f39b706": { @@ -1537,11 +1537,11 @@ "instruction.md": "859ed5b18395c73dccaec3a4907e424f7efc55ef21fc1a97a9eabec4fcd8a46d", "solution/expected.json": "04f4eb1c7419a854222ec7eb44faafc493064fa2fc5973b381dcc17b933866b0", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "2f2cc3752213e63ca08c318dd8f484319b5df6674e47418f2a74f1816d3003b6", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "e3635558a9bf5823b89a9a10f9a117f3785a16da0dab4e3b193b1d706599a4b2", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "ecc6cecad2a24ccfb195d8f83343fe8f28204869a30261379f191655c7748e1f", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--titration-packet-01-5447251bdb": { @@ -1554,11 +1554,11 @@ "instruction.md": "fb38798adb241048991be05a1dddcc012b42aced7cb9dc625ae78e682dfaa89d", "solution/expected.json": "649a0cdd4cdecfac95c19b675a1e6cdbad836121d33c77398c92f89700833fc1", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "967cd021dcb8fa21665c7873c01a6e69a038c10c4e090176840743c4e52790e7", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "09ad217e56983598bf940abce12b9d3ae1fb54bbbd7fc0ac28a19cb5caa02945", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "a418bd6e3e9d72f3855d8d5275de74ecadcaddf277eec54a954acd1d257eb902", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--tower-coverage-credit-01-437a513782": { @@ -1571,11 +1571,11 @@ "instruction.md": "110d1e56e66abd10f3167265e7b9a3c37246c33512507f1201e6af73b90a3fa5", "solution/expected.json": "8a977ea2f7d6f898d655b6678ba63003ab16ef7d55cd63ae27cd31f677b5c2a2", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "c31b09cd5be288c5f6e40ec57ad0e66c025ecf46e6ea6d193649f33d7815755e", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "1e6d5254c7b339dae0bdee9db65d05db04f9c0aaaf1f20659d418cdb44626ece", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "9951b42530babd1d01ba85b35752c8bdbf96adbda88bd0b2c5ce877197bb2443", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "charts-inside-documents--well-completion-filing-01-15bad1b934": { @@ -1588,11 +1588,11 @@ "instruction.md": "3c02f3ca39a9153ebe1fe5fcbc3b0a90dc2e5692987ea5cd7f54844781c1100d", "solution/expected.json": "57ca14c0af19a65506fbadac2cd3d6fc5faf3d15b7d0ec60b57bc51b372e5400", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "b7689251db850bec20298c0b0a7c7e3d6b2aadf06987eb5a7441f770e3a6cedc", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "1b9860ed6b55b2ad205e2864ccbbdf688d270fe02129d6518fcdb8daa0a156b5", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "95624b1315a6b45255e837c79366151d43db1c6863d41fd31aadc7547c04603c", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "long-chart-sheets--borehole-core-log-01-de7f39e659": { @@ -1605,11 +1605,11 @@ "instruction.md": "7f5a691fedc37fb5752afb3893ea352a3316289cee73986fddfb727a6c332999", "solution/expected.json": "7d482abeae14e4d3e2d59bcf538dd5c1ee6d509592c9f3b5403f425f5fb74d71", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "0db6363c74f7e0052b6531aa658410e711839d7800eb496096af08d1c1fc46d3", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "fa34f654eb03360a962b81e9b3a12a162393f69a651e4a7e282fbe6f598229a1", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "a7300bd914a6c03f8eaf00c235324d4fa46b430cccda370876af3e3c04fc7c7a", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "long-chart-sheets--time-location-chart-01-0c3f1d3f57": { @@ -1622,11 +1622,11 @@ "instruction.md": "152dff2018f23db6d2b56be7608428d7b56e06b73ce7c443eaf0a160cf99fdcb", "solution/expected.json": "433be1c253b698362cf5123d7a2dd75792889292e8a33a8ff42cb74a23d0113e", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "c78b656d278ea6c2b3492d1753bf55d4fa45367e10b3cb72276e1abf4e2b315d", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7c365cca12a307e4297e7e2f64bc18843365d23ce47a6b51f02f50dcf2066a22", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "1e25ad40ba8d583f16d505ee17c0bad4c2da1e30f0b59b17e576feab1786e7cf", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "long-chart-sheets--time-location-chart-02-dec1fe654c": { @@ -1639,11 +1639,11 @@ "instruction.md": "fec22f46aa7e14ba464f1ee6b20d109db9f0db9d43e39935ff9d0b263580b642", "solution/expected.json": "ad7bdc84a6d429849e3008303f4e7489b177152308a2c15708f75f1e58fd6639", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "1a694971f98c748745fac846e9241870e934896703cc5c45804747f2816b080f", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "c875b584e56e8da90c847a7f852b85b2ab3a2ee1376e6b2b82a81d1023e5de4e", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "18f1f18dabe7c1c7aaa112e05c609324fdfe8624ac2b6a5e900c54e2c5acfe1b", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "long-chart-sheets--track-chart-01-c50d78eb22": { @@ -1656,11 +1656,11 @@ "instruction.md": "9fc851fb205857dbd19990442b15ef727f98a8e914420ea05ea218cb8920bca0", "solution/expected.json": "589152cc47166e5435ceefbe956767c620e7070dde4549dab0b2402c7357686b", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "f79dc360b3fe4f61775f30d41aa491861cdf43269452fe0efdd77eabb0c41403", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "255838db9fe45df61642e4ebecfee04166e72555ad7d4e509edea4566b5530f3", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "8991f1133a3505eb014e3cd8b15fdc12bd1cd63bbc21a494bddcc36df277b912", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "long-chart-sheets--wireline-log-01-d836fe3a46": { @@ -1673,11 +1673,11 @@ "instruction.md": "6e0d41d3a3c975f709a6c7a433bee145d4b273af5245e058caab95a430285a37", "solution/expected.json": "3d3b1ce7b31d2738d6df5b455eebe3645f0a5b140843aac92757334de92d89e9", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "6f8b42ddbb665380e7e1152784b071aa29e90bb3cc33beb77a9d6c8996456497", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "ab859ae5ebc39d8504df259871739a4ee4dd68aefb91407c8fcc7decd4991265", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "f286861194231fe91e1ee89e660a200ac0958db45ce8fc668265c30d26ef6d8a", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "long-chart-sheets--wireline-log-02-a77c57fdfb": { @@ -1690,11 +1690,11 @@ "instruction.md": "b1fc23cf06f75659726563020d47f1b2b56cedc35ac683239d9622b7d5831359", "solution/expected.json": "13bf5afc1021494deee9272db53dd5f8d92cece638d5910b4fecf5428d8dbf82", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "a4d20c2b7665761c3845371ca630ab9c9d8b9b2f9d55b1177830ae5eea3acb62", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7a71a606e471f098eff9e92953d0bc85060ec8eed23eb34b100d9cbb76242bce", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "15500f592c8e10cec8d1cca6bad4baf8e3608f25002e76d2e1ab17ba04cd8254", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } }, "long-chart-sheets--wireline-log-03-b0c57928bd": { @@ -1707,11 +1707,11 @@ "instruction.md": "fc5f9756fdc0bf4ca97990ac4e509edbd7a7ef66827dbf84d6ead1b48c8390b7", "solution/expected.json": "b83fe163419e84f2a0e007d6aae0e77645067acbe355e1b91cf464a03970de92", "solution/solve.sh": "c7b331ff0b7c78db26f048dc1d22d8a5d33ac6f4a07b2c3c2c1ebbedc448ff42", - "task.toml": "be7ebc94eb49b7e938527258c0ff54fc3b9ed6199ca9feee2df5c9a4046896c9", - "tests/Dockerfile": "a6beb5baff9304fde00f8e62c04a826c3197a836e08a35680b3935c774bbc9dd", + "task.toml": "7d5fd7fd71ffdba6489839826001c5a7809fce5685507270d3f07f4c84930ee0", + "tests/Dockerfile": "2adf085c25d327c9e41887725a4a2bb4ec375eb3433da123e7ee561ef8063c63", "tests/reference.test.json": "607b07936b94eb29455838b119d86113940c81a8faafa122885526f359557309", "tests/test.sh": "b117d92bf255eb3e6d0c368fac7b7f3c7cdd9d777be55e5e0a3e35fcb1e64922", - "tests/verifier.py": "7c32d631b0987546697f2c4f653dd527230c345937ee778c43f84a05770634ce" + "tests/verifier.py": "b2d258399e8c32d0e1575f163cc07a6ee4f11c1bdb87ae67163403ce39e0b644" } } } diff --git a/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/task.toml b/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/task.toml index e2f2467de596839d72e682481fa4d6634cdbeff9..e7ee4631a6b29813ba0050afd4ec83576162d2eb 100644 --- a/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/task.toml +++ b/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/agency_staffing_invoice_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:handwritten", "length:medium", "domain:D6"] diff --git a/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/Dockerfile b/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/Dockerfile +++ b/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/verifier.py b/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/verifier.py +++ b/tasks/charts-inside-documents--agency-staffing-invoice-01-9aebdbb0d3/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/task.toml b/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/task.toml index 40c4ee7c57f12345dad3fdd0feb86c8775f4e599..fe8fe9eb297a757499f08acc07071d8d0154d2b6 100644 --- a/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/task.toml +++ b/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/aggregate_qc_report_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D3"] diff --git a/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/Dockerfile b/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/Dockerfile +++ b/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/verifier.py b/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/verifier.py +++ b/tasks/charts-inside-documents--aggregate-qc-report-01-3bcd23f4aa/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/task.toml b/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/task.toml index 969e501e43a5f758a23a1e91f9dac8129bb76e5f..d257f2cf6ab42ad04fe5f9d80da55483f73b8d87 100644 --- a/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/task.toml +++ b/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/assessment_billing_run_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D8"] diff --git a/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/Dockerfile b/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/Dockerfile +++ b/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/verifier.py b/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/verifier.py +++ b/tasks/charts-inside-documents--assessment-billing-run-01-a758923341/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/task.toml b/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/task.toml index 6bf71e371b449f9e0a315aa885467633e0264805..9139db0663d1f7f2765b720000d0b878e76084ac 100644 --- a/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/task.toml +++ b/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/capacity_change_pack_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:image", "length:medium", "domain:D2"] diff --git a/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/Dockerfile b/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/Dockerfile +++ b/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/verifier.py b/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/verifier.py +++ b/tasks/charts-inside-documents--capacity-change-pack-01-426d0e3de2/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--chemo-verification-01-755808e636/task.toml b/tasks/charts-inside-documents--chemo-verification-01-755808e636/task.toml index 987b457fef954d19eb6231c442cd668af72621e2..d888cf3959c31c30c693ce76809fae426e9db176 100644 --- a/tasks/charts-inside-documents--chemo-verification-01-755808e636/task.toml +++ b/tasks/charts-inside-documents--chemo-verification-01-755808e636/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/chemo_verification_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D6"] diff --git a/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/Dockerfile b/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/Dockerfile +++ b/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/verifier.py b/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/verifier.py +++ b/tasks/charts-inside-documents--chemo-verification-01-755808e636/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/task.toml b/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/task.toml index f6141a5f0b63337a81c7d3bfb2cfc2329b6cf481..9171064300bbe1acaedd2ee553f4ebdbcf6d50d6 100644 --- a/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/task.toml +++ b/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/claims_triage_bundle_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/Dockerfile b/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/Dockerfile +++ b/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/verifier.py b/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/verifier.py +++ b/tasks/charts-inside-documents--claims-triage-bundle-01-6e0e405433/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/task.toml b/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/task.toml index d656fd453b9ad55e9dbc0da5732354e438a9b7de..dd2067ee11c40538b22615a4abc6a10fb5f5a86b 100644 --- a/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/task.toml +++ b/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/contractor_dispute_binder_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D3"] diff --git a/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/Dockerfile b/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/Dockerfile +++ b/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/verifier.py b/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/verifier.py +++ b/tasks/charts-inside-documents--contractor-dispute-binder-01-62110b282f/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/task.toml b/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/task.toml index aaf11d7bec73f7adcfa3631f1e925f7ee7dae3c6..d3d6a837e38e4c3115f1b9a5ea346a20eac2b363 100644 --- a/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/task.toml +++ b/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/dam_operations_report_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D2"] diff --git a/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/Dockerfile b/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/Dockerfile +++ b/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/verifier.py b/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/verifier.py +++ b/tasks/charts-inside-documents--dam-operations-report-01-dec2676e78/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/task.toml b/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/task.toml index 4e0212b6c96c16547e0014c88d26a39571e8fde4..a052a1f29eb7ac2c1f659b84ea32108aec288e22 100644 --- a/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/task.toml +++ b/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/drilling_report_bundle_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D2"] diff --git a/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/Dockerfile b/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/Dockerfile +++ b/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/verifier.py b/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/verifier.py +++ b/tasks/charts-inside-documents--drilling-report-bundle-01-9ba0552503/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/task.toml b/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/task.toml index 26ac15dbaad871e33be0c294610ca4ccbc508d54..affee2a07dae2046f486ce1d166f97161afb1c6b 100644 --- a/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/task.toml +++ b/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/earthwork_quantity_packet_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:image", "length:medium", "domain:D3"] diff --git a/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/Dockerfile b/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/Dockerfile +++ b/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/verifier.py b/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/verifier.py +++ b/tasks/charts-inside-documents--earthwork-quantity-packet-01-c12c7681e1/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/task.toml b/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/task.toml index 523e1b81a7012e0b9f729e5c92fa6898d6983672..5f6f583b14a87c7e955097a9d63df17b7189279c 100644 --- a/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/task.toml +++ b/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/eligibility_appeals_file_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D6"] diff --git a/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/Dockerfile b/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/Dockerfile +++ b/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/verifier.py b/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/verifier.py +++ b/tasks/charts-inside-documents--eligibility-appeals-file-01-220e0e6b43/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/task.toml b/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/task.toml index c77162b86bbf85e1fc9398e0e43abb85f3511678..bb6d983e1cca94b294609964b38961a2a3b8b8d0 100644 --- a/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/task.toml +++ b/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/gantt_schedule_board_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:short", "domain:D5"] diff --git a/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/Dockerfile b/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/Dockerfile +++ b/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/verifier.py b/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/verifier.py +++ b/tasks/charts-inside-documents--gantt-schedule-board-01-824296e2a8/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/task.toml b/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/task.toml index a0fd3c9da5244313f44cfa4b2a10aec69a159923..60a5645bd397346bbe4178ba824e4a84c37a9d0a 100644 --- a/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/task.toml +++ b/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/integrity_filing_annex_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D2"] diff --git a/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/Dockerfile b/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/Dockerfile +++ b/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/verifier.py b/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/verifier.py +++ b/tasks/charts-inside-documents--integrity-filing-annex-01-5eab6bac71/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/task.toml b/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/task.toml index 920cdcaa34c9b870368db52d9f828c3c99f5926b..718fe8afe6cd970f174fb11486ff4259fe4a6119 100644 --- a/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/task.toml +++ b/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/med_gas_shutdown_notice_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:image", "length:medium", "domain:D6"] diff --git a/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/Dockerfile b/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/Dockerfile +++ b/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/verifier.py b/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/verifier.py +++ b/tasks/charts-inside-documents--med-gas-shutdown-notice-01-a3c934ad1a/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/task.toml b/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/task.toml index 01fcb6e2ef98b58cf93ce21bcd8df52ed835de39..ae7cccb7dfadfc1ab1dda65568b292361cb2be0d 100644 --- a/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/task.toml +++ b/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/parking_variance_hearing_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D8"] diff --git a/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/Dockerfile b/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/Dockerfile +++ b/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/verifier.py b/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/verifier.py +++ b/tasks/charts-inside-documents--parking-variance-hearing-01-57fcc48058/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/task.toml b/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/task.toml index 9ef423da61861cc97db41bb6e6fa180bff6344c6..b36b0dbce4b898feeb72a04e62598c27129be02f 100644 --- a/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/task.toml +++ b/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/pipeline_inspection_report_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:image", "length:medium", "domain:D2"] diff --git a/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/Dockerfile b/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/Dockerfile +++ b/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/verifier.py b/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/verifier.py +++ b/tasks/charts-inside-documents--pipeline-inspection-report-01-78ea67a3bf/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/task.toml b/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/task.toml index 158b9152b5ebebd31fb525b68203577d11fc93e1..a787621a5e1ace54f8876291027d2d91b450b0c5 100644 --- a/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/task.toml +++ b/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/pump_station_calculation_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D2"] diff --git a/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/Dockerfile b/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/Dockerfile +++ b/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/verifier.py b/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/verifier.py +++ b/tasks/charts-inside-documents--pump-station-calculation-01-a0afde405c/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/task.toml b/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/task.toml index cea723133fa637dac7ad4e763779e823fcc49970..3b66bf78adda088ac2584f9661f1ae3fe3c6b661 100644 --- a/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/task.toml +++ b/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/qt_audit_bulletin_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D6"] diff --git a/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/Dockerfile b/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/Dockerfile +++ b/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/verifier.py b/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/verifier.py +++ b/tasks/charts-inside-documents--qt-audit-bulletin-01-6dedae178d/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/task.toml b/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/task.toml index 92f3851990c181e0fd5e296eebe469af6a8da0a5..751302133c48b0b5d562ca6343409731b7bfff5d 100644 --- a/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/task.toml +++ b/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/rezoning_notice_packet_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D8"] diff --git a/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/Dockerfile b/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/Dockerfile +++ b/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/verifier.py b/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/verifier.py +++ b/tasks/charts-inside-documents--rezoning-notice-packet-01-6c316f7570/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/task.toml b/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/task.toml index 974ed41a31fb775df0e435b5492b60f37f7cdd4a..e0d455153fa64e6e93fdbf2997c7a42077cad5af 100644 --- a/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/task.toml +++ b/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/right_of_way_acquisition_packet_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D8"] diff --git a/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/Dockerfile b/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/Dockerfile +++ b/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/verifier.py b/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/verifier.py +++ b/tasks/charts-inside-documents--right-of-way-acquisition-packet-01-82a597ee1f/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--site-plan-review-01-09b2228232/task.toml b/tasks/charts-inside-documents--site-plan-review-01-09b2228232/task.toml index 495f2e5f947b9cb6e2f3616183d5142651736086..dc6677ffb4e194f2bc03d6b3939746bbe995d07c 100644 --- a/tasks/charts-inside-documents--site-plan-review-01-09b2228232/task.toml +++ b/tasks/charts-inside-documents--site-plan-review-01-09b2228232/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/site_plan_review_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D8"] diff --git a/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/Dockerfile b/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/Dockerfile +++ b/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/verifier.py b/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/verifier.py +++ b/tasks/charts-inside-documents--site-plan-review-01-09b2228232/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/task.toml b/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/task.toml index da2fc4c183ff6065ea123583a66767e489371581..80719a703e928b709cf25ac24f9545f58af6ffe2 100644 --- a/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/task.toml +++ b/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/stock_declaration_file_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D5"] diff --git a/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/Dockerfile b/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/Dockerfile +++ b/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/verifier.py b/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/verifier.py +++ b/tasks/charts-inside-documents--stock-declaration-file-01-328f39b706/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--titration-packet-01-5447251bdb/task.toml b/tasks/charts-inside-documents--titration-packet-01-5447251bdb/task.toml index bdbc60a6283c3685ea2336990b4ff932bba13637..f1c67818ca27eed712b4cb6498971ede5bb3c85d 100644 --- a/tasks/charts-inside-documents--titration-packet-01-5447251bdb/task.toml +++ b/tasks/charts-inside-documents--titration-packet-01-5447251bdb/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/titration_packet_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:image", "length:medium", "domain:D6"] diff --git a/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/Dockerfile b/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/Dockerfile +++ b/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/verifier.py b/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/verifier.py +++ b/tasks/charts-inside-documents--titration-packet-01-5447251bdb/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/task.toml b/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/task.toml index c96e2df97e98f8bab83ad33a6ff8cf60c1149565..179d6440b35dcaa0caeb5578f35d9f3fc1cb8bba 100644 --- a/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/task.toml +++ b/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/tower_coverage_credit_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:digital", "length:medium", "domain:D5"] diff --git a/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/Dockerfile b/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/Dockerfile +++ b/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/verifier.py b/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/verifier.py +++ b/tasks/charts-inside-documents--tower-coverage-credit-01-437a513782/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/task.toml b/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/task.toml index b5caa1ccf63d0fca65f10c7011a3b11a0ef9e54e..bfd6e16fc7f201f86a4726df116b654458acd510 100644 --- a/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/task.toml +++ b/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "charts_inside_documents/well_completion_filing_01" source_split = "charts_inside_documents" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:charts_inside_documents", "perception:scan", "length:medium", "domain:D2"] diff --git a/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/Dockerfile b/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/Dockerfile +++ b/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/verifier.py b/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/verifier.py +++ b/tasks/charts-inside-documents--well-completion-filing-01-15bad1b934/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--benefits-census-01-b3aba18799/task.toml b/tasks/document-conventions--benefits-census-01-b3aba18799/task.toml index 6003671f8c7da0df18374a9ffe5ba261f930ff14..c217d6f62dbc78beb40748d0cafd4f28bb9245f0 100644 --- a/tasks/document-conventions--benefits-census-01-b3aba18799/task.toml +++ b/tasks/document-conventions--benefits-census-01-b3aba18799/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/benefits_census_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:medium", "domain:D6"] diff --git a/tasks/document-conventions--benefits-census-01-b3aba18799/tests/Dockerfile b/tasks/document-conventions--benefits-census-01-b3aba18799/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--benefits-census-01-b3aba18799/tests/Dockerfile +++ b/tasks/document-conventions--benefits-census-01-b3aba18799/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--benefits-census-01-b3aba18799/tests/verifier.py b/tasks/document-conventions--benefits-census-01-b3aba18799/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--benefits-census-01-b3aba18799/tests/verifier.py +++ b/tasks/document-conventions--benefits-census-01-b3aba18799/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--clinical-listing-01-16558a50f4/task.toml b/tasks/document-conventions--clinical-listing-01-16558a50f4/task.toml index 23180f022880032e6628747f00f7660c777dd083..fe42db585d47a10b8c691d001842215c5c1e33b6 100644 --- a/tasks/document-conventions--clinical-listing-01-16558a50f4/task.toml +++ b/tasks/document-conventions--clinical-listing-01-16558a50f4/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/clinical_listing_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:medium", "domain:D6"] diff --git a/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/Dockerfile b/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/Dockerfile +++ b/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/verifier.py b/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/verifier.py +++ b/tasks/document-conventions--clinical-listing-01-16558a50f4/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/task.toml b/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/task.toml index b7209c47e8a962e21e336be17f3c3da279010a4c..e255b5535c020b1492dd181aa49437bc459dbbc8 100644 --- a/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/task.toml +++ b/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/customs_entry_7501_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:handwritten", "length:medium", "domain:D5"] diff --git a/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/Dockerfile b/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/Dockerfile +++ b/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/verifier.py b/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/verifier.py +++ b/tasks/document-conventions--customs-entry-7501-01-2b38a10d05/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/task.toml b/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/task.toml index 6172ab985435642e6ea5e72118f604cc48ec8aa1..2c8a7bcb70858ac95c7af3de2f34d91cf4782766 100644 --- a/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/task.toml +++ b/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/gl_trial_balance_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:heavy_scan", "length:long", "domain:D1"] diff --git a/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/Dockerfile b/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/Dockerfile +++ b/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/verifier.py b/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/verifier.py +++ b/tasks/document-conventions--gl-trial-balance-01-fcfae79cc4/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--gl-trial-balance-02-1b649a914a/task.toml b/tasks/document-conventions--gl-trial-balance-02-1b649a914a/task.toml index 2dd4995f536b8820f1eace6faafae0bf3d46ac66..702b834ba76cda538b86ac894878038626f564cc 100644 --- a/tasks/document-conventions--gl-trial-balance-02-1b649a914a/task.toml +++ b/tasks/document-conventions--gl-trial-balance-02-1b649a914a/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/gl_trial_balance_02" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:digital", "length:medium", "domain:D1"] diff --git a/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/Dockerfile b/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/Dockerfile +++ b/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/verifier.py b/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/verifier.py +++ b/tasks/document-conventions--gl-trial-balance-02-1b649a914a/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/task.toml b/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/task.toml index 0085ce24e24ce3bc48fb7e9661b809f14ea337e2..1badf927d00ce508858a38546eee0f0a9fdb76f3 100644 --- a/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/task.toml +++ b/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/grant_award_form_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:handwritten", "length:medium", "domain:D3"] diff --git a/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/Dockerfile b/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/Dockerfile +++ b/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/verifier.py b/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/verifier.py +++ b/tasks/document-conventions--grant-award-form-01-9f99cf9d0b/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--insurance-schedule-01-d09fbeff57/task.toml b/tasks/document-conventions--insurance-schedule-01-d09fbeff57/task.toml index c047441bb9a7dc8f2d41e1587d2625549a2d5a33..07427652ad8f70937717f3f1edfe6e8adfbc2284 100644 --- a/tasks/document-conventions--insurance-schedule-01-d09fbeff57/task.toml +++ b/tasks/document-conventions--insurance-schedule-01-d09fbeff57/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/insurance_schedule_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/Dockerfile b/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/Dockerfile +++ b/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/verifier.py b/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/verifier.py +++ b/tasks/document-conventions--insurance-schedule-01-d09fbeff57/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--investor-report-01-4eb56d214c/task.toml b/tasks/document-conventions--investor-report-01-4eb56d214c/task.toml index f749f5f194fd0b41af63a4023147a3152dd38252..bb3cd1c9a2493322565b4c6eece1f7f7f83eee3b 100644 --- a/tasks/document-conventions--investor-report-01-4eb56d214c/task.toml +++ b/tasks/document-conventions--investor-report-01-4eb56d214c/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/investor_report_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:long", "domain:D1"] diff --git a/tasks/document-conventions--investor-report-01-4eb56d214c/tests/Dockerfile b/tasks/document-conventions--investor-report-01-4eb56d214c/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--investor-report-01-4eb56d214c/tests/Dockerfile +++ b/tasks/document-conventions--investor-report-01-4eb56d214c/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--investor-report-01-4eb56d214c/tests/verifier.py b/tasks/document-conventions--investor-report-01-4eb56d214c/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--investor-report-01-4eb56d214c/tests/verifier.py +++ b/tasks/document-conventions--investor-report-01-4eb56d214c/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--loss-run-01-5186f1382f/task.toml b/tasks/document-conventions--loss-run-01-5186f1382f/task.toml index f484f068d4cd39494dc57aacf72954535b0ac4eb..5913457dd28f9ee7f66548dbeca0e89c2236abed 100644 --- a/tasks/document-conventions--loss-run-01-5186f1382f/task.toml +++ b/tasks/document-conventions--loss-run-01-5186f1382f/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/loss_run_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/document-conventions--loss-run-01-5186f1382f/tests/Dockerfile b/tasks/document-conventions--loss-run-01-5186f1382f/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--loss-run-01-5186f1382f/tests/Dockerfile +++ b/tasks/document-conventions--loss-run-01-5186f1382f/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--loss-run-01-5186f1382f/tests/verifier.py b/tasks/document-conventions--loss-run-01-5186f1382f/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--loss-run-01-5186f1382f/tests/verifier.py +++ b/tasks/document-conventions--loss-run-01-5186f1382f/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--loss-run-02-06daebb84e/task.toml b/tasks/document-conventions--loss-run-02-06daebb84e/task.toml index c69b9b3a2d4fcc4b45d5e5d8392a0b43d68c37a1..f92e1e0e90b10dda9c47aed03ac7104cb66cacb0 100644 --- a/tasks/document-conventions--loss-run-02-06daebb84e/task.toml +++ b/tasks/document-conventions--loss-run-02-06daebb84e/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/loss_run_02" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:digital", "length:medium", "domain:D1"] diff --git a/tasks/document-conventions--loss-run-02-06daebb84e/tests/Dockerfile b/tasks/document-conventions--loss-run-02-06daebb84e/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--loss-run-02-06daebb84e/tests/Dockerfile +++ b/tasks/document-conventions--loss-run-02-06daebb84e/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--loss-run-02-06daebb84e/tests/verifier.py b/tasks/document-conventions--loss-run-02-06daebb84e/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--loss-run-02-06daebb84e/tests/verifier.py +++ b/tasks/document-conventions--loss-run-02-06daebb84e/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--mortgage-application-1003-01-223f497b34/task.toml b/tasks/document-conventions--mortgage-application-1003-01-223f497b34/task.toml index d6e94be7d5129e1edb75bf2baac0a546fe5baf0e..0e1672b3a75f238798279ba3d2530b9381931545 100644 --- a/tasks/document-conventions--mortgage-application-1003-01-223f497b34/task.toml +++ b/tasks/document-conventions--mortgage-application-1003-01-223f497b34/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/mortgage_application_1003_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:handwritten", "length:medium", "domain:D8"] diff --git a/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/Dockerfile b/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/Dockerfile +++ b/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/verifier.py b/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/verifier.py +++ b/tasks/document-conventions--mortgage-application-1003-01-223f497b34/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--patient-record-01-d96494bdeb/task.toml b/tasks/document-conventions--patient-record-01-d96494bdeb/task.toml index 796611996c355c73e6e4cf62421b8317586d8342..c8a3c7f125a66f7977e93f7fdc1063b30f13c1bd 100644 --- a/tasks/document-conventions--patient-record-01-d96494bdeb/task.toml +++ b/tasks/document-conventions--patient-record-01-d96494bdeb/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/patient_record_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:long", "domain:D6"] diff --git a/tasks/document-conventions--patient-record-01-d96494bdeb/tests/Dockerfile b/tasks/document-conventions--patient-record-01-d96494bdeb/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--patient-record-01-d96494bdeb/tests/Dockerfile +++ b/tasks/document-conventions--patient-record-01-d96494bdeb/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--patient-record-01-d96494bdeb/tests/verifier.py b/tasks/document-conventions--patient-record-01-d96494bdeb/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--patient-record-01-d96494bdeb/tests/verifier.py +++ b/tasks/document-conventions--patient-record-01-d96494bdeb/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--payment-remittance-01-8b2f95de82/task.toml b/tasks/document-conventions--payment-remittance-01-8b2f95de82/task.toml index c3e24ddab9323ec7aca4cad3b45a8abf5117aa1e..a0910b9d123ff16716b0bad5d77593c52faddfe2 100644 --- a/tasks/document-conventions--payment-remittance-01-8b2f95de82/task.toml +++ b/tasks/document-conventions--payment-remittance-01-8b2f95de82/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/payment_remittance_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:long", "domain:D6"] diff --git a/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/Dockerfile b/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/Dockerfile +++ b/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/verifier.py b/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/verifier.py +++ b/tasks/document-conventions--payment-remittance-01-8b2f95de82/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/task.toml b/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/task.toml index 927c24a2375dbf920b4a8f981280b0644946a04c..19056f2ffa4893abf013a42a36041faf084a1fe3 100644 --- a/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/task.toml +++ b/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/payroll_audit_packet_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:long", "domain:D1"] diff --git a/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/Dockerfile b/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/Dockerfile +++ b/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/verifier.py b/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/verifier.py +++ b/tasks/document-conventions--payroll-audit-packet-01-82d20c9737/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--property-bulletin-01-d9f7a0071d/task.toml b/tasks/document-conventions--property-bulletin-01-d9f7a0071d/task.toml index 378aa1554069aaad458c3248cb7a5b7cc3fd9532..fe58045387d876cfc80010c438db9d505b7b1b95 100644 --- a/tasks/document-conventions--property-bulletin-01-d9f7a0071d/task.toml +++ b/tasks/document-conventions--property-bulletin-01-d9f7a0071d/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/property_bulletin_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:digital", "length:medium", "domain:D8"] diff --git a/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/Dockerfile b/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/Dockerfile +++ b/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/verifier.py b/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/verifier.py +++ b/tasks/document-conventions--property-bulletin-01-d9f7a0071d/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--regulations-01-f0515332e7/task.toml b/tasks/document-conventions--regulations-01-f0515332e7/task.toml index 44939688f815311d3771cc7a78d150b1ddae9a11..cc8ae6ad713374f956fb7ffab81230ef7f4c28a0 100644 --- a/tasks/document-conventions--regulations-01-f0515332e7/task.toml +++ b/tasks/document-conventions--regulations-01-f0515332e7/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/regulations_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:image", "length:medium", "domain:D3"] diff --git a/tasks/document-conventions--regulations-01-f0515332e7/tests/Dockerfile b/tasks/document-conventions--regulations-01-f0515332e7/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--regulations-01-f0515332e7/tests/Dockerfile +++ b/tasks/document-conventions--regulations-01-f0515332e7/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--regulations-01-f0515332e7/tests/verifier.py b/tasks/document-conventions--regulations-01-f0515332e7/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--regulations-01-f0515332e7/tests/verifier.py +++ b/tasks/document-conventions--regulations-01-f0515332e7/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--regulations-02-f7b2d65449/task.toml b/tasks/document-conventions--regulations-02-f7b2d65449/task.toml index 0d7a4912872e54b61492ae6dde1180b1cf4cc79d..8e9a547fbdaa9492d045a6f40d35c530e250ee46 100644 --- a/tasks/document-conventions--regulations-02-f7b2d65449/task.toml +++ b/tasks/document-conventions--regulations-02-f7b2d65449/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/regulations_02" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:long", "domain:D3"] diff --git a/tasks/document-conventions--regulations-02-f7b2d65449/tests/Dockerfile b/tasks/document-conventions--regulations-02-f7b2d65449/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--regulations-02-f7b2d65449/tests/Dockerfile +++ b/tasks/document-conventions--regulations-02-f7b2d65449/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--regulations-02-f7b2d65449/tests/verifier.py b/tasks/document-conventions--regulations-02-f7b2d65449/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--regulations-02-f7b2d65449/tests/verifier.py +++ b/tasks/document-conventions--regulations-02-f7b2d65449/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--sec-13f-report-01-577282a002/task.toml b/tasks/document-conventions--sec-13f-report-01-577282a002/task.toml index af8f4dbab4da11c92558b29c32128d5ce44cab49..87b34136cea563e35411c473dee96d59bb0d9681 100644 --- a/tasks/document-conventions--sec-13f-report-01-577282a002/task.toml +++ b/tasks/document-conventions--sec-13f-report-01-577282a002/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/sec_13f_report_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/document-conventions--sec-13f-report-01-577282a002/tests/Dockerfile b/tasks/document-conventions--sec-13f-report-01-577282a002/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--sec-13f-report-01-577282a002/tests/Dockerfile +++ b/tasks/document-conventions--sec-13f-report-01-577282a002/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--sec-13f-report-01-577282a002/tests/verifier.py b/tasks/document-conventions--sec-13f-report-01-577282a002/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--sec-13f-report-01-577282a002/tests/verifier.py +++ b/tasks/document-conventions--sec-13f-report-01-577282a002/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--ub04-claim-form-01-1251817721/task.toml b/tasks/document-conventions--ub04-claim-form-01-1251817721/task.toml index b8b09eea84cbb256d155aca8a28462acf29190ea..e6c40dc43f962feb4e81da9350b01c102e3a07a2 100644 --- a/tasks/document-conventions--ub04-claim-form-01-1251817721/task.toml +++ b/tasks/document-conventions--ub04-claim-form-01-1251817721/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/ub04_claim_form_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:handwritten", "length:medium", "domain:D6"] diff --git a/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/Dockerfile b/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/Dockerfile +++ b/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/verifier.py b/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/verifier.py +++ b/tasks/document-conventions--ub04-claim-form-01-1251817721/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--ucc-search-form-01-c81c96afb9/task.toml b/tasks/document-conventions--ucc-search-form-01-c81c96afb9/task.toml index 8701768b4453c10a8cea119549d25562f7f181a1..703849ca4209c137f63d36b8f480ebd3f6c33ac7 100644 --- a/tasks/document-conventions--ucc-search-form-01-c81c96afb9/task.toml +++ b/tasks/document-conventions--ucc-search-form-01-c81c96afb9/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/ucc_search_form_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:handwritten", "length:medium", "domain:D7"] diff --git a/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/Dockerfile b/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/Dockerfile +++ b/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/verifier.py b/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/verifier.py +++ b/tasks/document-conventions--ucc-search-form-01-c81c96afb9/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--utility-invoice-01-fc8a2801b6/task.toml b/tasks/document-conventions--utility-invoice-01-fc8a2801b6/task.toml index e7682b57c9e1b6cdc2e2acc629af1ea1805e19bc..a5b36bf0c78692dec872cf8c57a6571787406ed1 100644 --- a/tasks/document-conventions--utility-invoice-01-fc8a2801b6/task.toml +++ b/tasks/document-conventions--utility-invoice-01-fc8a2801b6/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/utility_invoice_01" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:scan", "length:medium", "domain:D2"] diff --git a/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/Dockerfile b/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/Dockerfile +++ b/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/verifier.py b/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/verifier.py +++ b/tasks/document-conventions--utility-invoice-01-fc8a2801b6/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/document-conventions--utility-invoice-02-de65eb0697/task.toml b/tasks/document-conventions--utility-invoice-02-de65eb0697/task.toml index 59fea993b826cb36dd36bfe60e12b472b87fd34f..b22f088031f0578f4fb3e77b481e6040f6eedd28 100644 --- a/tasks/document-conventions--utility-invoice-02-de65eb0697/task.toml +++ b/tasks/document-conventions--utility-invoice-02-de65eb0697/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "document_conventions/utility_invoice_02" source_split = "document_conventions" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:document_conventions", "perception:digital", "length:medium", "domain:D2"] diff --git a/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/Dockerfile b/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/Dockerfile +++ b/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/verifier.py b/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/verifier.py +++ b/tasks/document-conventions--utility-invoice-02-de65eb0697/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--audit-findings-report-01-fd21326b37/task.toml b/tasks/drawn-relations--audit-findings-report-01-fd21326b37/task.toml index bf68513e9a4c0028b7bd3c73514c82e0a9ac11a3..a5792f9e39c4b3424b8fa9351e1ffb3e943e1698 100644 --- a/tasks/drawn-relations--audit-findings-report-01-fd21326b37/task.toml +++ b/tasks/drawn-relations--audit-findings-report-01-fd21326b37/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/audit_findings_report_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/Dockerfile b/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/Dockerfile +++ b/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/verifier.py b/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/verifier.py +++ b/tasks/drawn-relations--audit-findings-report-01-fd21326b37/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/task.toml b/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/task.toml index cdc956b4d234c10cf6e75c1b0390ee74a9da4a8b..726b5b0d9eb95dc52daccbfd906a0f090ed39456 100644 --- a/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/task.toml +++ b/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/capital_call_notice_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/Dockerfile b/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/Dockerfile +++ b/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/verifier.py b/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/verifier.py +++ b/tasks/drawn-relations--capital-call-notice-01-150bb5fa8d/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/task.toml b/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/task.toml index f8d7b504aebfd062aca58585d00213a46c208a7b..675234320eee6354120fd8acedaca7f979f439e6 100644 --- a/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/task.toml +++ b/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/credit_facility_binder_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/Dockerfile b/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/Dockerfile +++ b/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/verifier.py b/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/verifier.py +++ b/tasks/drawn-relations--credit-facility-binder-01-898ff3eb10/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/task.toml b/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/task.toml index d8e7eeed7b27a83e4cc44ab04b77e45c3de7ce82..d622aa6bdbde38a15bdf30d668d079af0aa2c4d9 100644 --- a/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/task.toml +++ b/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/credit_facility_binder_02" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/Dockerfile b/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/Dockerfile +++ b/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/verifier.py b/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/verifier.py +++ b/tasks/drawn-relations--credit-facility-binder-02-19b22c187a/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/task.toml b/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/task.toml index 2234f66a28c9435241408206d8d06d3b1aa5d65d..d0c4a0abe6b33771d1ce1b8e7bc2999b2a3d748d 100644 --- a/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/task.toml +++ b/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/fibre_splice_record_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:scan", "length:medium", "domain:D8"] diff --git a/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/Dockerfile b/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/Dockerfile +++ b/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/verifier.py b/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/verifier.py +++ b/tasks/drawn-relations--fibre-splice-record-01-f48117ae51/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/task.toml b/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/task.toml index 3b76771753c26d0725dad3e9e25f28c6648e2a71..ccca40f0c8f5da65d7fbd4a00b85e76066a40abd 100644 --- a/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/task.toml +++ b/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/fund_structure_file_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/Dockerfile b/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/Dockerfile +++ b/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/verifier.py b/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/verifier.py +++ b/tasks/drawn-relations--fund-structure-file-01-5d1a8e7039/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/task.toml b/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/task.toml index c560a1683abb4f8862f4d85434d825741f695ad7..1eea4d057f8c5e7013e8a83e3d9b63eba2054f36 100644 --- a/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/task.toml +++ b/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/fund_structure_file_02" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:image", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/Dockerfile b/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/Dockerfile +++ b/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/verifier.py b/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/verifier.py +++ b/tasks/drawn-relations--fund-structure-file-02-fae5e4fa30/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/task.toml b/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/task.toml index 75ebe5277a06935fb31e2313b69acec7a7056deb..9755e95ae5ac385c4b9a96aabacfb74bf2b5352b 100644 --- a/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/task.toml +++ b/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/hvac_balancing_report_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:scan", "length:medium", "domain:D8"] diff --git a/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/Dockerfile b/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/Dockerfile +++ b/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/verifier.py b/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/verifier.py +++ b/tasks/drawn-relations--hvac-balancing-report-01-42b2bc9260/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/task.toml b/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/task.toml index 7006426d36d24819f586851818d7aeb3cd39481c..2ca3e4b86be142174547e2888a81648c390811aa 100644 --- a/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/task.toml +++ b/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/hvac_balancing_report_02" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D8"] diff --git a/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/Dockerfile b/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/Dockerfile +++ b/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/verifier.py b/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/verifier.py +++ b/tasks/drawn-relations--hvac-balancing-report-02-d986d6e9f4/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/task.toml b/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/task.toml index 47f051c7c59c76881ee08b5273eb10b3b0388ab6..1d7dfc57d86601b644f9616be3875dc23ec571b2 100644 --- a/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/task.toml +++ b/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/insurance_programme_file_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/Dockerfile b/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/Dockerfile +++ b/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/verifier.py b/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/verifier.py +++ b/tasks/drawn-relations--insurance-programme-file-01-d62ce4f3d0/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/task.toml b/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/task.toml index 10fc8fbde9212f57104f1304bb721dcfee5ed0a5..102d3ed9df32bc1e567928e330d34b2df47ef794 100644 --- a/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/task.toml +++ b/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/insurance_programme_file_02" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D1"] diff --git a/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/Dockerfile b/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/Dockerfile +++ b/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/verifier.py b/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/verifier.py +++ b/tasks/drawn-relations--insurance-programme-file-02-7ecb036814/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--network-change-request-01-59bb1d126e/task.toml b/tasks/drawn-relations--network-change-request-01-59bb1d126e/task.toml index 947a252fe91bca92f857c51b1ef4be2699153c88..8ddce289eb27d67a7679f1aeeb92088d0cdc86de 100644 --- a/tasks/drawn-relations--network-change-request-01-59bb1d126e/task.toml +++ b/tasks/drawn-relations--network-change-request-01-59bb1d126e/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/network_change_request_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D8"] diff --git a/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/Dockerfile b/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/Dockerfile +++ b/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/verifier.py b/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/verifier.py +++ b/tasks/drawn-relations--network-change-request-01-59bb1d126e/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--network-change-request-02-d6a581e913/task.toml b/tasks/drawn-relations--network-change-request-02-d6a581e913/task.toml index 50992e649142cb64697099bddf70e0ce1e1e4b29..2c64eb4c08156e980b6392f14f8c66df319f3db4 100644 --- a/tasks/drawn-relations--network-change-request-02-d6a581e913/task.toml +++ b/tasks/drawn-relations--network-change-request-02-d6a581e913/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/network_change_request_02" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D8"] diff --git a/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/Dockerfile b/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/Dockerfile +++ b/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/verifier.py b/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/verifier.py +++ b/tasks/drawn-relations--network-change-request-02-d6a581e913/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/task.toml b/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/task.toml index c4a7b282392a0d218632bd5fb57df8322ab581a0..2dc8c6f16054a0e45e86d9f2b63ec7744d5e9876 100644 --- a/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/task.toml +++ b/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/one_line_commissioning_binder_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:image", "length:medium", "domain:D2"] diff --git a/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/Dockerfile b/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/Dockerfile +++ b/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/verifier.py b/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/verifier.py +++ b/tasks/drawn-relations--one-line-commissioning-binder-01-fd8ba37089/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/task.toml b/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/task.toml index 42c5d884cc6717fdc835de3dd1d441c930699c3e..049fa041bade57756716252e2262cc80513b1281 100644 --- a/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/task.toml +++ b/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/one_line_commissioning_binder_02" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:scan", "length:medium", "domain:D2"] diff --git a/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/Dockerfile b/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/Dockerfile +++ b/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/verifier.py b/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/verifier.py +++ b/tasks/drawn-relations--one-line-commissioning-binder-02-a4e599abe8/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--probate-court-file-01-f41ffed757/task.toml b/tasks/drawn-relations--probate-court-file-01-f41ffed757/task.toml index 53bc3245d020219d132425ee7eafe4c5a92dee3e..44d1f7becadc7e85443b29462f3a86ed05364313 100644 --- a/tasks/drawn-relations--probate-court-file-01-f41ffed757/task.toml +++ b/tasks/drawn-relations--probate-court-file-01-f41ffed757/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/probate_court_file_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:handwritten", "length:medium", "domain:D7"] diff --git a/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/Dockerfile b/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/Dockerfile +++ b/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/verifier.py b/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/verifier.py +++ b/tasks/drawn-relations--probate-court-file-01-f41ffed757/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/task.toml b/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/task.toml index 49ac6ef948bcb3284842ec970e3c9f672cd4b0ab..cd1e3ab542a318d69ae52b798d6b4debb340e6a2 100644 --- a/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/task.toml +++ b/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/procurement_audit_pack_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D3"] diff --git a/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/Dockerfile b/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/Dockerfile +++ b/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/verifier.py b/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/verifier.py +++ b/tasks/drawn-relations--procurement-audit-pack-01-74e76ae05d/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/task.toml b/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/task.toml index d78383a00c9d5268bbe5c7aeb50d534236fb2cb7..58fbb99aeb828d3796ab5731e6666c2e3caa899f 100644 --- a/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/task.toml +++ b/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/tournament_results_pack_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D3"] diff --git a/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/Dockerfile b/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/Dockerfile +++ b/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/verifier.py b/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/verifier.py +++ b/tasks/drawn-relations--tournament-results-pack-01-a03e7b61ef/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/task.toml b/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/task.toml index 784a3d2158a6d10cfa1bd224da16cb506085ec51..1bd1ed5e1abf370bfa88c5bdd77262f715a24211 100644 --- a/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/task.toml +++ b/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/water_loss_audit_01" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:digital", "length:medium", "domain:D2"] diff --git a/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/Dockerfile b/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/Dockerfile +++ b/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/verifier.py b/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/verifier.py +++ b/tasks/drawn-relations--water-loss-audit-01-5a91bf77f1/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/drawn-relations--water-loss-audit-02-9fee656174/task.toml b/tasks/drawn-relations--water-loss-audit-02-9fee656174/task.toml index 8f20b1e5db242aa43bc2e4c0666c00d9806408c0..f8b2aab0e911126e197e41888ef01deb7ce53acb 100644 --- a/tasks/drawn-relations--water-loss-audit-02-9fee656174/task.toml +++ b/tasks/drawn-relations--water-loss-audit-02-9fee656174/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "drawn_relations/water_loss_audit_02" source_split = "drawn_relations" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:drawn_relations", "perception:scan", "length:medium", "domain:D2"] diff --git a/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/Dockerfile b/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/Dockerfile +++ b/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/verifier.py b/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/verifier.py +++ b/tasks/drawn-relations--water-loss-audit-02-9fee656174/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/task.toml b/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/task.toml index 7b456f122cd2aaf2bd254544c2044817b594e2ed..9b4746a9665909a174d16b9e3b3838cd226962a6 100644 --- a/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/task.toml +++ b/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/college_cohort_file_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:heavy_scan", "length:medium", "domain:D3"] diff --git a/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/Dockerfile b/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/Dockerfile +++ b/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/verifier.py b/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/verifier.py +++ b/tasks/house-counting-rules--college-cohort-file-01-acc6b22631/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/task.toml b/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/task.toml index 5ce3fdc7243183efee1c566a5632a64b33c8247f..b48d76a23ec9813941edb8b0a253e0047d000ccd 100644 --- a/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/task.toml +++ b/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/container_demurrage_claim_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D5"] diff --git a/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/Dockerfile b/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/Dockerfile +++ b/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/verifier.py b/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/verifier.py +++ b/tasks/house-counting-rules--container-demurrage-claim-01-c28cd4183b/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/task.toml b/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/task.toml index 0d87ccfce9de8a9885b2ee694e604967e4753317..844226385b8b45a67920381596377bbd1f493159 100644 --- a/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/task.toml +++ b/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/election_canvass_binder_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D3"] diff --git a/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/Dockerfile b/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/Dockerfile +++ b/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/verifier.py b/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/verifier.py +++ b/tasks/house-counting-rules--election-canvass-binder-01-38b76c8225/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/task.toml b/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/task.toml index 92787951f2906f0d28104a3eec5417b2abeed30a..53130e4def27edde93ea24e5c583d99016db5184 100644 --- a/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/task.toml +++ b/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/engine_utilisation_return_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/Dockerfile b/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/Dockerfile +++ b/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/verifier.py b/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/verifier.py +++ b/tasks/house-counting-rules--engine-utilisation-return-01-0161f8f230/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/task.toml b/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/task.toml index 742af4c447d2875efd933481f5be69b234e0cc69..505475ea705c17890a764b6a1290e1940f158657 100644 --- a/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/task.toml +++ b/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/franchise_royalty_report_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:digital", "length:medium", "domain:D1"] diff --git a/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/Dockerfile b/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/Dockerfile +++ b/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/verifier.py b/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/verifier.py +++ b/tasks/house-counting-rules--franchise-royalty-report-01-2cc1afb849/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/task.toml b/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/task.toml index 4fa9c8754a2f4d260997c41c2876ead8a56b57e6..b5287c93a3ff9842f4cafcd4133b946697e1ee00 100644 --- a/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/task.toml +++ b/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/landfill_diversion_return_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D3"] diff --git a/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/Dockerfile b/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/Dockerfile +++ b/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/verifier.py b/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/verifier.py +++ b/tasks/house-counting-rules--landfill-diversion-return-01-01b7a7f4d1/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--library-aid-claim-01-86213ded48/task.toml b/tasks/house-counting-rules--library-aid-claim-01-86213ded48/task.toml index 30f043aaa628d2dad683b2605f8308fc0ba1ef2d..2c7cbd34ff5b27c3b67fe32c8292c5b2733bea58 100644 --- a/tasks/house-counting-rules--library-aid-claim-01-86213ded48/task.toml +++ b/tasks/house-counting-rules--library-aid-claim-01-86213ded48/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/library_aid_claim_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:heavy_scan", "length:medium", "domain:D3"] diff --git a/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/Dockerfile b/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/Dockerfile +++ b/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/verifier.py b/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/verifier.py +++ b/tasks/house-counting-rules--library-aid-claim-01-86213ded48/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/task.toml b/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/task.toml index c5b8eedd4f6f4d5f2aca81da79debdc2cc432b90..85dfc55bf07e795114db616c68b8296bb7fb8364 100644 --- a/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/task.toml +++ b/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/mortgage_servicing_report_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/Dockerfile b/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/Dockerfile +++ b/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/verifier.py b/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/verifier.py +++ b/tasks/house-counting-rules--mortgage-servicing-report-01-7bbb926cfc/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/task.toml b/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/task.toml index efdeca9e8c3ff001eea4d72929a42fdf9c11955e..56c31158176fe1bbdb60e4684d8335b3ec8bfc3e 100644 --- a/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/task.toml +++ b/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/premium_audit_worksheet_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:heavy_scan", "length:medium", "domain:D1"] diff --git a/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/Dockerfile b/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/Dockerfile +++ b/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/verifier.py b/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/verifier.py +++ b/tasks/house-counting-rules--premium-audit-worksheet-01-d643f66576/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/task.toml b/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/task.toml index 7832632cc68bdf3808e566d61ae160998061ab22..9a24847871304186b982c8fd73e4cd7ce3c2b9bf 100644 --- a/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/task.toml +++ b/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/travel_expense_binder_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/Dockerfile b/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/Dockerfile +++ b/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/verifier.py b/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/verifier.py +++ b/tasks/house-counting-rules--travel-expense-binder-01-0be1c101d6/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/task.toml b/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/task.toml index e4cbd618f0773e06f68e0c7d286ce150262fa9f7..9bb587f7d8a6d23bef8d4e88a04b014508c11178 100644 --- a/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/task.toml +++ b/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/tv_post_buy_affidavit_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/Dockerfile b/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/Dockerfile +++ b/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/verifier.py b/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/verifier.py +++ b/tasks/house-counting-rules--tv-post-buy-affidavit-01-ee2482f807/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/task.toml b/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/task.toml index e23f5c700a7d4c2185d56fe395f67674a6c0da8b..30d5b444140fd222259e215690cf82265679ccc0 100644 --- a/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/task.toml +++ b/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_counting_rules/vendor_statement_reconciliation_01" source_split = "house_counting_rules" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_counting_rules", "perception:scan", "length:medium", "domain:D5"] diff --git a/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/Dockerfile b/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/Dockerfile +++ b/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/verifier.py b/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/verifier.py +++ b/tasks/house-counting-rules--vendor-statement-reconciliation-01-b7dd86993c/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/task.toml b/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/task.toml index 52f567baa4977d6109805a4505f27818d9e85416..d9606dc34b49128ec8a49c669c705597c80308b3 100644 --- a/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/task.toml +++ b/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/care_home_census_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D6"] diff --git a/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/Dockerfile b/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/Dockerfile +++ b/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/verifier.py b/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/verifier.py +++ b/tasks/house-vocabulary--care-home-census-review-01-91658ecb4e/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/task.toml b/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/task.toml index c0060b07dfe2136f55cc60a3d775c6744f8aabd7..bea1a0ea200103e098f60ff81820d8805714eaf6 100644 --- a/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/task.toml +++ b/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/circulation_audit_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D1"] diff --git a/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/Dockerfile b/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/Dockerfile +++ b/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/verifier.py b/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/verifier.py +++ b/tasks/house-vocabulary--circulation-audit-01-baf7e137c4/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/task.toml b/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/task.toml index a897bb9feba54e748231bf7ea5bcb78df8912c00..c10288f410dcbccc19de26e2ef46ef0b13add3c2 100644 --- a/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/task.toml +++ b/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/demand_response_settlement_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:long", "domain:D2"] diff --git a/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/Dockerfile b/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/Dockerfile +++ b/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/verifier.py b/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/verifier.py +++ b/tasks/house-vocabulary--demand-response-settlement-01-b4e75b045c/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/task.toml b/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/task.toml index 2096b599408ceb5d6461d9af21c5b4e3969a7737..6df3d63ad46c3fca716d57f86ed662a64a919222 100644 --- a/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/task.toml +++ b/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/export_credit_policy_results_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D1"] diff --git a/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/Dockerfile b/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/Dockerfile +++ b/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/verifier.py b/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/verifier.py +++ b/tasks/house-vocabulary--export-credit-policy-results-01-827e718a5c/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/task.toml b/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/task.toml index ae6b54ab2a67be3b924e3b12f19902f998c2cd5a..90133bbac8aff85c3f0658c51fbf5bf9b695c789 100644 --- a/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/task.toml +++ b/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/hotel_room_block_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D8"] diff --git a/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/Dockerfile b/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/Dockerfile +++ b/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/verifier.py b/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/verifier.py +++ b/tasks/house-vocabulary--hotel-room-block-review-01-6a489feb62/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/task.toml b/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/task.toml index a7deb0f20d6396801b7ba0093fa521a254f0ce44..6b97e6a7711a78addc61532c82f4da130b0b0e6f 100644 --- a/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/task.toml +++ b/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/import_duty_reconciliation_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:long", "domain:D5"] diff --git a/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/Dockerfile b/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/Dockerfile +++ b/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/verifier.py b/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/verifier.py +++ b/tasks/house-vocabulary--import-duty-reconciliation-01-ab2e322239/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/task.toml b/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/task.toml index 60ddb89b905b6285a69d028344e88b84a718416c..3642e3de54e86e17f25dd2f41c47b364c583aeac 100644 --- a/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/task.toml +++ b/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/joint_interest_billing_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:long", "domain:D2"] diff --git a/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/Dockerfile b/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/Dockerfile +++ b/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/verifier.py b/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/verifier.py +++ b/tasks/house-vocabulary--joint-interest-billing-review-01-fdea88b7e0/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/task.toml b/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/task.toml index 5c086aa199bcb1b9905fb355779c4e6f6c8b8f5a..d41c7325d9ba9532125c0ac5fb82b941db5927a3 100644 --- a/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/task.toml +++ b/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/lab_safety_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:scan", "length:long", "domain:D6"] diff --git a/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/Dockerfile b/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/Dockerfile +++ b/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/verifier.py b/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/verifier.py +++ b/tasks/house-vocabulary--lab-safety-review-01-7bac338a61/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/task.toml b/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/task.toml index 654dd09087182ae797e3cba2a22fa6dfc6d52651..53598dd75c33dc315c3cf3cdab09cff9b0eb2679 100644 --- a/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/task.toml +++ b/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/purchase_contract_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:long", "domain:D5"] diff --git a/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/Dockerfile b/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/Dockerfile +++ b/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/verifier.py b/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/verifier.py +++ b/tasks/house-vocabulary--purchase-contract-review-01-3cb1f19945/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/task.toml b/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/task.toml index 7f8e369905040067b6ea392a5430472471af98a9..d4796013f6dc7e28b30b8f9cc5cc04a8e4fbef67 100644 --- a/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/task.toml +++ b/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/school_enrollment_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D3"] diff --git a/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/Dockerfile b/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/Dockerfile +++ b/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/verifier.py b/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/verifier.py +++ b/tasks/house-vocabulary--school-enrollment-review-01-325e9dc90f/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/task.toml b/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/task.toml index a9e7535457dddd81acf1230594a5043616c70501..8378fb6ee2434875473ac7bca6278431747f0c01 100644 --- a/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/task.toml +++ b/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/show_entry_check_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D7"] diff --git a/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/Dockerfile b/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/Dockerfile +++ b/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/verifier.py b/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/verifier.py +++ b/tasks/house-vocabulary--show-entry-check-01-51f2a49fd3/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--spread-betting-account-01-84013d8161/task.toml b/tasks/house-vocabulary--spread-betting-account-01-84013d8161/task.toml index 223c23f7db31d2bd5e4cc8e01a492cb61476a3f8..91045e73d208bf58bd4fe4e4dbf572f1cb6af756 100644 --- a/tasks/house-vocabulary--spread-betting-account-01-84013d8161/task.toml +++ b/tasks/house-vocabulary--spread-betting-account-01-84013d8161/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/spread_betting_account_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D1"] diff --git a/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/Dockerfile b/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/Dockerfile +++ b/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/verifier.py b/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/verifier.py +++ b/tasks/house-vocabulary--spread-betting-account-01-84013d8161/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/task.toml b/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/task.toml index af8d0e7a98f6d730eaee1d4472af6c942a912311..3aa8ea7fa5f49f89e80ba0202174eef350a3a185 100644 --- a/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/task.toml +++ b/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/subscription_seat_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:scan", "length:medium", "domain:D1"] diff --git a/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/Dockerfile b/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/Dockerfile +++ b/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/verifier.py b/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/verifier.py +++ b/tasks/house-vocabulary--subscription-seat-review-01-444b57cd9b/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/task.toml b/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/task.toml index ba3242869b6dfb8a629761b1a37994f321ae0c8e..9888b8cd2d7fd4f9b14c5680b35fb5e0a91eabcc 100644 --- a/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/task.toml +++ b/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "house_vocabulary/transit_ridership_review_01" source_split = "house_vocabulary" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:house_vocabulary", "perception:heavy_scan", "length:medium", "domain:D3"] diff --git a/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/Dockerfile b/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/Dockerfile +++ b/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/verifier.py b/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/verifier.py +++ b/tasks/house-vocabulary--transit-ridership-review-01-c555e728cb/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/task.toml b/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/task.toml index 1f66b4c15f75bf9a02aafa3f28e3dc7b5a788eea..eee4319a96f0d37fa39e47a73e3c9c2a4252da47 100644 --- a/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/task.toml +++ b/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "long_chart_sheets/borehole_core_log_01" source_split = "long_chart_sheets" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:long_chart_sheets", "perception:scan", "length:short", "domain:D2"] diff --git a/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/Dockerfile b/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/Dockerfile +++ b/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/verifier.py b/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/verifier.py +++ b/tasks/long-chart-sheets--borehole-core-log-01-de7f39e659/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/task.toml b/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/task.toml index 90c9997702e2c04105a7c77453f9a1b30478c6f2..45c0af235f0308132638fcef84520fa217af7fdb 100644 --- a/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/task.toml +++ b/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "long_chart_sheets/time_location_chart_01" source_split = "long_chart_sheets" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:long_chart_sheets", "perception:scan", "length:short", "domain:D3"] diff --git a/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/Dockerfile b/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/Dockerfile +++ b/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/verifier.py b/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/verifier.py +++ b/tasks/long-chart-sheets--time-location-chart-01-0c3f1d3f57/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/task.toml b/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/task.toml index 28ad78c020bfdda95de0d621d3bf626ed576ff3b..0f74eb9a47c1f0b86ef65ef540787324a6b3d04a 100644 --- a/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/task.toml +++ b/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "long_chart_sheets/time_location_chart_02" source_split = "long_chart_sheets" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:long_chart_sheets", "perception:scan", "length:short", "domain:D3"] diff --git a/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/Dockerfile b/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/Dockerfile +++ b/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/verifier.py b/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/verifier.py +++ b/tasks/long-chart-sheets--time-location-chart-02-dec1fe654c/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/long-chart-sheets--track-chart-01-c50d78eb22/task.toml b/tasks/long-chart-sheets--track-chart-01-c50d78eb22/task.toml index 302ca979e49667a289d9d0d43745e40bf0ce1768..5af1594e67ffb220af50e6afb2a4eb8d031401cb 100644 --- a/tasks/long-chart-sheets--track-chart-01-c50d78eb22/task.toml +++ b/tasks/long-chart-sheets--track-chart-01-c50d78eb22/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "long_chart_sheets/track_chart_01" source_split = "long_chart_sheets" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:long_chart_sheets", "perception:scan", "length:short", "domain:D5"] diff --git a/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/Dockerfile b/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/Dockerfile +++ b/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/verifier.py b/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/verifier.py +++ b/tasks/long-chart-sheets--track-chart-01-c50d78eb22/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/task.toml b/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/task.toml index 80a9f4fb0cb4497f8fcbd021324cf64113e112cd..818e24f9d8bfbd72f0ed424a4f757bd0f331c34e 100644 --- a/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/task.toml +++ b/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "long_chart_sheets/wireline_log_01" source_split = "long_chart_sheets" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:long_chart_sheets", "perception:scan", "length:short", "domain:D2"] diff --git a/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/Dockerfile b/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/Dockerfile +++ b/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/verifier.py b/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/verifier.py +++ b/tasks/long-chart-sheets--wireline-log-01-d836fe3a46/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/task.toml b/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/task.toml index feed3d077efbb8df7440bf287987ab0f260a4b83..4657236a9352a9be210dc3a383439f81b76d5d55 100644 --- a/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/task.toml +++ b/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "long_chart_sheets/wireline_log_02" source_split = "long_chart_sheets" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:long_chart_sheets", "perception:scan", "length:short", "domain:D2"] diff --git a/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/Dockerfile b/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/Dockerfile +++ b/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/verifier.py b/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/verifier.py +++ b/tasks/long-chart-sheets--wireline-log-02-a77c57fdfb/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report diff --git a/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/task.toml b/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/task.toml index d9408f53c34832ce28b28e59e1518c11522d9971..76b9ddab3b824e5a540bcc2ecc0486e492599b51 100644 --- a/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/task.toml +++ b/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/task.toml @@ -6,7 +6,7 @@ source_repo = "llamaindex/ExtractBenchPro" source_revision = "16f6672e06cf77491ec6d18c817d67864b90d845" source_case_id = "long_chart_sheets/wireline_log_03" source_split = "long_chart_sheets" -scorer_revision = "741c1b651e8851c1bd3424ac4d41b643b9e41761" +scorer_revision = "2f27f100730afc7c395602e26a2a87e07ea66b31" prompt_source = "https://arxiv.org/html/2607.29677v1#A3.SS1" tags = ["source:synthetic", "challenge:long_chart_sheets", "perception:scan", "length:short", "domain:D2"] diff --git a/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/Dockerfile b/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/Dockerfile index a963aa9557d308cbbee0c9d0a4db53e1acda3693..b8b776f394a2adbe013a748629953afcb9b26069 100644 --- a/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/Dockerfile +++ b/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.12-slim-bookworm RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@741c1b651e8851c1bd3424ac4d41b643b9e41761" "parse-bench==1.0.4" +RUN pip install --no-cache-dir "llama-extract-bench @ git+https://github.com/run-llama/ExtractBench.git@2f27f100730afc7c395602e26a2a87e07ea66b31" "parse-bench==1.0.4" WORKDIR /app COPY . /tests/ diff --git a/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/verifier.py b/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/verifier.py index ee0c8c3b2239a5a496cb7c0dbad455e0fe9ba661..2ffb32b308c5d4d2f77e9895084df8bf6396d3c8 100644 --- a/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/verifier.py +++ b/tasks/long-chart-sheets--wireline-log-03-b0c57928bd/tests/verifier.py @@ -4,18 +4,57 @@ from __future__ import annotations import argparse import json +from collections.abc import Mapping, Sequence from datetime import UTC, datetime from pathlib import Path from typing import Any from extract_bench.evaluation.evaluators.extract import ExtractEvaluator +from extract_bench.evaluation.metrics.extract.unified_evidence_metric import ValueCell from extract_bench.evaluation.score_case import load_extract_test_case from extract_bench.schemas.extract_output import ExtractOutput from extract_bench.schemas.pipeline_io import InferenceRequest, InferenceResult from extract_bench.schemas.product import ProductType -def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: +def _feedback(cells: Sequence[ValueCell], metadata: Mapping[str, Any]) -> dict[str, Any]: + expected = sum(cell.gt_path is not None for cell in cells) + predicted = sum(cell.pred_path is not None for cell in cells) + matched = sum(cell.value_correct for cell in cells) + if (expected, predicted, matched) != ( + metadata["expected_cells"], + metadata["predicted_cells"], + metadata["v_correct"], + ): + raise ValueError("Value feedback does not account for the scorer's cell counts") + denominator = expected + predicted + entries = [] + for cell in cells: + if cell.gt_path is None: + outcome = "prediction_only" + elif cell.pred_path is None: + outcome = "reference_only" + else: + outcome = "matched" if cell.value_correct else "value_differs" + entries.append( + { + "reference_path": cell.gt_path, + "output_path": cell.pred_path, + "outcome": outcome, + "f1_credit": 2.0 / denominator if cell.value_correct else 0.0, + } + ) + return { + "schema_version": 1, + "status": "scored", + "path_space": "normalized_scoring_inputs", + "counts": {"expected": expected, "predicted": predicted, "matched": matched}, + "value_incomplete": metadata["value_incomplete"], + "cells": entries, + } + + +def score_prediction(test_json: Path, prediction: Any) -> tuple[dict[str, float], dict[str, Any]]: """Use exactly the normal evaluator's normalization and metric selection.""" case = load_extract_test_case(test_json, source_file=Path("/app/document.pdf")) now = datetime.now(UTC) @@ -38,12 +77,15 @@ def score_prediction(test_json: Path, prediction: Any) -> dict[str, float]: completed_at=now, latency_in_ms=0, ) - bundle = ExtractEvaluator().compute_metrics(result, case) - return { + cells: list[ValueCell] = [] + bundle = ExtractEvaluator().compute_metrics(result, case, value_cells=cells) + metrics = { metric.metric_name: metric.value for metric in bundle.metrics if metric.metric_name.startswith("extract_unified_value_") } + value_f1 = next(metric for metric in bundle.metrics if metric.metric_name == "extract_unified_value_f1") + return metrics, _feedback(cells, value_f1.metadata) def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, Any]: @@ -54,7 +96,8 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A """ log_dir.mkdir(parents=True, exist_ok=True) reward_path = log_dir / "reward.txt" - reward_path.unlink(missing_ok=True) + for name in ("reward.txt", "metrics.json", "feedback.json"): + (log_dir / name).unlink(missing_ok=True) try: prediction = json.loads(prediction_path.read_text(encoding="utf-8")) except (FileNotFoundError, UnicodeDecodeError, json.JSONDecodeError) as error: @@ -63,14 +106,17 @@ def verify(test_json: Path, prediction_path: Path, log_dir: Path) -> dict[str, A if not isinstance(prediction, dict): report = {"status": "invalid_submission", "error": "Expected one JSON object", "value_f1": 0.0} else: - metrics = score_prediction(test_json, prediction) + metrics, feedback = score_prediction(test_json, prediction) report = { "status": "scored", "value_f1": metrics["extract_unified_value_f1"], "metrics": metrics, } + if report["status"] == "invalid_submission": + feedback = {"schema_version": 1, "status": "invalid_submission", "error": report["error"], "cells": []} report["perfect"] = int(report["value_f1"] == 1.0) (log_dir / "metrics.json").write_text(json.dumps(report, indent=2, allow_nan=False) + "\n", encoding="utf-8") + (log_dir / "feedback.json").write_text(json.dumps(feedback, indent=2, allow_nan=False) + "\n", encoding="utf-8") reward_path.write_text(f"{report['value_f1']}\n", encoding="utf-8") return report