Load already-judged results keyed by doc_id, for resume support.
(path: Path)
| 265 | |
| 266 | |
| 267 | def load_existing_results(path: Path) -> dict[int, dict]: |
| 268 | """Load already-judged results keyed by doc_id, for resume support.""" |
| 269 | results = {} |
| 270 | if not path.exists(): |
| 271 | return results |
| 272 | with open(path) as f: |
| 273 | for line in f: |
| 274 | line = line.strip() |
| 275 | if line: |
| 276 | r = json.loads(line) |
| 277 | results[r["doc_id"]] = r |
| 278 | return results |
| 279 | |
| 280 | |
| 281 | def extract_reference(doc_answer: str) -> str: |