feat(threshold): raise default private_date post-filter to 0.85#46
Open
lBroth wants to merge 1 commit into
Open
feat(threshold): raise default private_date post-filter to 0.85#46lBroth wants to merge 1 commit into
lBroth wants to merge 1 commit into
Conversation
The GLiNER model is over-eager on bare calendar dates without identifying context — a system-prompt line like "Today's date is 2026-05-21" or a copyright footer like "© 2024 Acme Inc." gets tagged as `private_date` and erodes the token budget on every roundtrip without protecting anyone. Add `DEFAULT_CATEGORY_THRESHOLDS` with `private_date: 0.85` and merge it into the post-filter on a key-by-key basis — user-supplied `categoryThresholds` still win for the labels they spell out. Spans above 0.85 (DOB, birth-date, explicit personal-date PII) keep firing; the long tail of generic dates drops. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
The GLiNER model is over-eager on bare calendar dates without identifying context — a system-prompt line like
Today's date is 2026-05-21or a footer like© 2024 Acme Inc.gets taggedprivate_dateand erodes the token budget on every roundtrip without protecting anyone.This adds
DEFAULT_CATEGORY_THRESHOLDSwithprivate_date: 0.85and merges it into the post-filter on a key-by-key basis — user-suppliedcategoryThresholdsstill win for the labels they spell out. Spans above 0.85 (DOB, birth-date, explicit personal-date PII) keep firing; the long tail of generic dates drops.Files
src/defaults.ts—DEFAULT_CATEGORY_THRESHOLDS = { private_date: 0.85 }src/nullpii.ts— merge built-in + user thresholds; user keys wintest/nullpii.test.ts— 2 integration tests: weak-date dropped / strong-date kept; user override still worksTest plan
npm test— 273 passing (was 271)npm run typecheck/lint/build— cleanpackages/evalon a date-heavy corpus to confirm no recall regression on DOB / birth-date / explicit dated PII (model emits these well above 0.9 in eval-loop history). Defer until bench run is convenient.Rationale
Choice of 0.85 is conservative — sits halfway between the global decode threshold (0.5) and the high-precision recognizer floor (0.95). If bench shows recall regression on legitimate dated PII the right knob is
private_date-specific not the global cut.🤖 Generated with Claude Code