Repository navigation
fix(interface): flag rows whose coverage judge finds missed entities - #356
Merged
binaryaaron merged 3 commits intoNov 5, 2026
Merged
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryRewrite-mode
Reviews (5) · Last reviewed commit: "docs(evaluation): note that an unflagged..." · Reviewed by Greptile |
Collaborator
|
cc @memadi-nv could you review? |
binaryaaron
force-pushed
the
aagonzales/bugfix/evaluate-coverage-review-flag
branch
from
November 4, 2026 20:13
6ffced0 to
d87ddbb
Compare
memadi-nv
approved these changes
Nov 4, 2026
memadi-nv
left a comment
Contributor
There was a problem hiding this comment.
Thanks for catching this edge case Aaron, LGTM! Just added some clarification note to the docs as a suggestion.
In Rewrite mode, Anonymizer.evaluate() now sets needs_human_review=True on any row whose entity coverage judge reports non-empty missed_entities. Rows with no missed entities or unavailable coverage keep their flag, and the run() output is unchanged. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Size each missed_entities cell with .str.len() and set the review flag with mask() instead of a per-cell isinstance check and a copy/.loc update. Coverage cells are always Python lists by this point, so the flags and the needs_human_review dtype are unchanged. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
needs_human_review=False is not a guarantee: coverage feeds the flag only when evaluate() runs, and detection and the coverage judge can both miss entities. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
binaryaaron
force-pushed
the
aagonzales/bugfix/evaluate-coverage-review-flag
branch
from
November 5, 2026 16:16
ad5b287 to
9436fee
Compare
binaryaaron
deleted the
aagonzales/bugfix/evaluate-coverage-review-flag
branch
November 5, 2026 16:21
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.
In Rewrite mode,
Anonymizer.evaluate()now setsneeds_human_reviewto True on any record whose coverage judge reports a non-emptymissed_entities. Until now the judge wroteentity_coverageandmissed_entitiesand left the flag alone, so a name detection never caught could reach the output verbatim withneeds_human_reviewFalse.Why
In a 25-record run with a local open-weight model at low reasoning effort, GLiNER and the LLM augmenter both missed two subject surnames, which survived the rewrite verbatim. The coverage judge in
evaluate()caught both, but nothing acted on it: 7 of 25 records had a non-emptymissed_entities, 4 of them unflagged. A hosted model had found the same surnames every time, so the gap depends on the augmenter's model and effort, and the flag is where a user looks.What changes
After the coverage judge runs in
evaluate(), rows whosemissed_entitiesis a non-empty list getneeds_human_review = True. Empty lists,Noneand NaN leave the flag unchanged; frames without the column (Replace mode) are returned as is; the Boolean dtype is preserved; therun()result is not modified.docs/concepts/rewrite.md,docs/concepts/evaluation.md,docs/troubleshooting.mdand the rewrite-evaluation devnote each gain one sentence naming the new cause.13 source lines. No public signature, column or default changes; detection, the rewrite workflow and the repair loop are untouched.
Checks
ruff format --check,ruff checkandmake typecheckpass;make test: 1,587 passed.tests/interface/test_anonymizer_interface.pywith a stubbedEntityCoverageWorkflowthrough the realevaluate()path: a missed entity flags the record; an already-flagged record stays flagged; no missed entities and an unavailable coverage result leave the flag unchanged. Each case asserts thebooleandtype and untouchedrun()flags. The first case fails without the fix.For reviewers
tests/interface/test_anonymizer_interface.py(theevaluatecoverage-flag cases).run()output byte-identical;needs_human_reviewkeeps its Boolean dtype.🤖 Generated with Claude Code