In this article
To measure what a PII filter misses, label 200 of your own texts by hand, run the filter on them and count four things: what it missed in full, what it missed in part, what it hid by mistake and whether the AI answer still works.
A page says a filter catches 98 percent. On whose text? Their sample has their languages, their formats and their idea of what counts as private. Yours has Portuguese support tickets, scanned-then-typed contracts and a client called Lusomar that a model might read as a place.
This is the method behind our line "Ask any tool how much it misses". It works on any filter, ours included, and it takes an afternoon.
Step 1: build a labelled sample
Pick the texts first, before you look at any tool's output.
- How many. Start with 200 texts. That is enough to see a pattern and small enough to label by hand. If a type is rare in your data, such as passport numbers, add texts that contain it until you have at least 30 examples of it.
- Which texts. Take them from the real flow: tickets, chats, contracts, forms. Mix the languages you serve in the proportions you serve them. Include some clean texts with nothing private, because a filter also fails by hiding too much.
- Which types. Write down the types you care about before you label: names, emails, phone numbers, tax numbers, addresses, health details, company names. A short list keeps the labelling consistent.
- Who labels. Two people label each text on their own. Where they disagree, a third person decides, and you keep the disagreement rate. If your two labellers differ on 15 percent of the spans, no tool can score above what they agree on.
Store each label as a span: the text, the type, and the start and end position in the text.
Step 2: count four things
Run the filter on the texts and compare its spans with your labels. Count:
- Missed in full. A labelled span with no detection touching it. The private data goes to the model as written.
- Missed in part. A detection covers some of the span, such as "Ana" when the label is "Ana Silva". The surname still leaves.
- Hidden by mistake. A detection with no label under it, such as a product name read as a person. The AI loses information it needed.
- The AI's answer after hiding. Run the task on the original text and on the hidden text. Score both answers with the same checklist. A filter that hides all the text has no misses and no useful answers.
Counts 1 to 3 are numbers. Count 4 is a judgement, so have your two people score a sample of answers and keep the disagreements too.
A snippet that does the counting
Spans are (start, end) pairs, counted in characters. labelled holds your spans for one text and detected holds the tool's.
def overlap(a, b):
return max(0, min(a[1], b[1]) - max(a[0], b[0]))
def score(labelled, detected):
missed_full = missed_part = 0
for lab in labelled:
covered = sum(overlap(lab, det) for det in detected)
size = lab[1] - lab[0]
if covered == 0:
missed_full += 1
elif covered < size:
missed_part += 1
by_mistake = sum(
1 for det in detected if not any(overlap(det, lab) for lab in labelled)
)
return {
"labelled": len(labelled),
"missed_full": missed_full,
"missed_part": missed_part,
"by_mistake": by_mistake,
}
def total(rows):
out = {}
for labelled, detected in rows:
for k, v in score(labelled, detected).items():
out[k] = out.get(k, 0) + v
return outRun total(rows) over all your texts. Report the three counts next to the number of labelled spans, and report them per type. An overall figure of "3 percent missed" can hide that all the misses are tax numbers.
One limit of the snippet: a span covered by two detections is counted as covered, even if a gap sits between them. Add a check on the union of the detections if your data has long spans such as addresses.
Compare two tools on equal terms
The comparison only means something if both tools face the same test.
- Same rows. Run both tools on the same 200 texts, with the same labels.
- Same types. If one tool cannot detect health details and the other can, score both on the types they both claim, then show the rest as a separate line.
- Same settings. Write down each tool's settings, such as a confidence threshold or a list of excluded types, and change nothing between runs.
- Same counting. Use one scoring script for both. Do not use the numbers each vendor prints.
- Show the rows. Keep the list of misses for each tool. Two tools with the same count can miss different things, and the list shows which miss matters to you.
Anyone may test Opami Protect and publish the result. Our own method is public, so you can check yours against it.
Our method in public → Test us and publish what you find →
Opami Protect misses some private data, and your sample will show where. A tool that hands you the list of what it missed has given you something to work with.


