docs: add devnote for hybrid entity detection - #258
Conversation
Explains Anonymizer's three-stage entity detection pipeline (candidate detection, validation, augmentation) and presents benchmark results on OpenPII and Nemotron PII. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: asteier2026 <asteier@nvidia.com>
Greptile SummaryAdds a developer note describing Anonymizer’s hybrid entity-detection architecture and benchmark results.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
|
|
|
||
| > **Was this candidate the right decision?** | ||
|
|
||
| Validation never searches for new entities. It simply reviews each candidate and decides whether to keep, drop, or reclassify it. That's fundamentally a reasoning task, making it a natural fit for an LLM. |
There was a problem hiding this comment.
Validation coverage is overstated
Validation decisions are generated before augmentation, and augmented entities without matching decisions are kept unchanged. Saying that validation reviews “each candidate” therefore gives readers an inaccurate model in which augmented entities also receive keep/drop/reclassify review.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Made suggested changes
Augmentation runs after validation, so recovered entities are never sent through validation. Explain why: GLiNER trades precision for recall so its candidates need LLM review, while the augmenter's own suggestions are already high precision. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: asteier2026 <asteier@nvidia.com>
|
|
||
| <div style="text-align: center;" markdown> | ||
|
|
||
| { loading=lazy } |
There was a problem hiding this comment.
The Rescriber recall values in the plots conflict with the tables. The OpenPII plot places Rescriber at approximately 0.52 recall, while Table 1 reports 83.0%. The Nemotron plot likewise shows approximately 0.52, while Table 2 reports 67.8%. This appears specific to the Rescriber data, other plotted values seem to match their table entries 🤔
There was a problem hiding this comment.
Good catch. I fixed it.
|
|
||
| > **What explicit entities haven't been identified yet?** | ||
|
|
||
| This stage isn't correcting earlier decisions. It's looking for entities that were never proposed as candidates. |
There was a problem hiding this comment.
Thinking about this some more, I wonder if this is truly accurate 🤔
The augmenter receives the post-validation tagged text and validated entity list. A candidate dropped during validation is therefore untagged and absent from that list, allowing the augmenter to propose it again. This stage searches for entities missing from the validated set—not exclusively entities that GLiNER never proposed. Maybe it's just semantics, but just raising in case we want to clarify
There was a problem hiding this comment.
I think it's fine. What are the odds of gliner suggesting something, then validate drops it, then augment finds again. Pretty slim.
|
|
||
| **One problem. Three specialized reasoning tasks.** | ||
|
|
||
| As the next section shows, each stage contributes measurable improvements, and together they consistently outperform any individual stage operating alone. |
There was a problem hiding this comment.
This one is from agents: The OpenPII ablation reports an F1 score of 0.837 for augmentation alone and 0.826 for the complete pipeline, as the article later acknowledges. Should we describe it as achieving the highest recall, or explicitly state the privacy-weighted objective being optimized?
There was a problem hiding this comment.
I explain this later, that all together gives us the highest recall, but just aug gives slightly higher F1, then tried to say that recall is what we want.
Table 1 and Table 2 listed stale Rescriber recall figures that conflicted with the precision/recall plots. Corrected to match the plotted values (51.9% on OpenPII, 52.0% on Nemotron PII). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: asteier2026 <asteier@nvidia.com>
Summary
Test plan
make docs-serveand reviewed the post, images, tables, and footnote citationsmake format-check🤖 Generated with Claude Code