Key Takeaways
- A single accuracy percentage hides the failures that matter. Measure precision, recall and F1 for every entity type.
- Recall is the privacy metric. Every false negative is a piece of personal data that reached the model or the reader.
- How you count a match changes the score. Decide between strict and partial span matching before you compare tools.
- Your test set is only as good as its labels. Use written guidelines, two annotators and an adjudication step.
- Scanned documents, other languages, tables and context-dependent identifiers break systems that look perfect on clean text.
- Accuracy is not permanent. Rerun the same test suite after every model, rule or threshold change.
Most teams find out how well their redaction works by accident, when someone spots a name that should have been masked. That is a poor way to learn. Read AI data masking puts it, detection is the real bottleneck: a masking layer can only protect what it finds.
The good news is that PII detection can be measured with the same discipline as any other classifier. The method below works whether you are evaluating a vendor, tuning an open-source model or checking your own pipeline before it touches production data.
Why a Single Accuracy Number Misleads
Vendors like to quote one figure, often described as accuracy. In a typical document, though, the vast majority of words are not personal data at all. A system that masked nothing would still label most tokens correctly, so a headline accuracy score can look excellent while names, account numbers, and addresses slip through untouched.
What you actually need to know is narrower. Of the identifiers that exist in the text, how many did the system catch? Of the things it masked or how many were really identifiers? And does the answer change for phone numbers versus free-text names, or for typed emails versus scanned forms? Those questions decide whether a workflow is safe, and they matter even more once you will understand the difference between redaction and anonymization, because each technique depends on detection being right first.
Precision, Recall and F1, Applied to PII
Three numbers do most of the work. Precision is the share of detected items that really were personal data. Recall is the share of real personal data that the system detected. F1 is the harmonic mean of the two, so it only rises when both rise. In redaction terms, low precision means over-masking and damaged documents, while low recall means leaks.




