Unified single-call date extraction#466
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates COMPASS’s ordinance date extraction to use a single whole-document LLM call (with the source URL treated only as a hint) instead of the prior per-page voting + URL-shortcut approach, and updates dev evaluation artifacts to reflect the improved accuracy.
Changes:
- Reworked
DateExtractor.parse()to build one prompt from the full document text and optionally include the download URL as corroborating context. - Replaced the old multi-response voting
_parse_datelogic with a simpler validation-based parser for a single response (but see review comment re: backward compatibility with existing tests/callers). - Updated dev eval summary JSON and per-case CSV breakdown with new accuracy/cost/token numbers.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
compass/extraction/date.py |
Switches to one whole-document LLM call; updates prompt/system guidance; simplifies response parsing/validation. |
evals/results/dev/date_extraction_evals.json |
Updates aggregate dev eval metrics reflecting the new extraction approach. |
evals/results/dev/date_extraction_evals_breakdown.csv |
Updates per-document dev eval outcomes and token/cost breakdown. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #466 +/- ##
==========================================
+ Coverage 60.86% 61.16% +0.30%
==========================================
Files 77 77
Lines 6843 6850 +7
Branches 670 672 +2
==========================================
+ Hits 4165 4190 +25
+ Misses 2561 2543 -18
Partials 117 117
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Replaces the per-page-voting + URL-shortcut date extractor with a single whole-document LLM call: the URL is passed as a hint, but the document text is the source of truth.
Fixes three failure modes in the old extractor:
{year: null}response and skip the document bodyDev eval accuracy 0.43 → 0.94 (2 failing of 35).