fix: derive eval subjects from document content (prof-cgu)#43
Merged
Conversation
Why: Encode the synthetic-eval subject convention in code so ground-truth rows describe document content rather than the document-type form the file's header prohibits.
Changes:
- Derive each row's subject via a model call against generated text, with a structural forbidden= guard that rejects the f"{category} {doctype}" form
- Add scripts/backfill_eval_subjects.py to apply the same derivation in place across existing PDFs, preserving comments, key order, and entity fields
- Validate --ai-model against MODEL_PRICING at startup; collect-then-apply on cost-cap abort; share an atomic-write helper with the generator
- Add tests for sanitizer normalization, forbidden-form retry, empty-text raise, and fallback behavior
- Rewrite the 80 subjects in eval/ground_truth/synthetic.jsonl to content-based form
Issues: prof-cgu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: Encode the synthetic-eval subject convention in code so ground-truth rows describe document content rather than the document-type form the file's header prohibits.
Changes:
Issues: prof-cgu