Five document recognizers cannot pass the default score gates
Affected module
Ingestion Framework
Describe the bug
Five enabled, content-targeted document recognizers match plausible values but cannot contribute their intended entity with the shipped settings: US passport, Indian passport, Italian driver license, Italian identity card, and Italian passport.
OpenMetadata's column-name context boost requires a raw score of at least 0.3. Each recognizer starts below that floor. Its configured confidenceThreshold: 0.6 then removes the result before Presidio's general context enhancer or the default TagProcessor can use it.
| Recognizer | Example column and value | Raw score | Current result with matching name |
|---|---|---|---|
UsPassportRecognizer |
us_passport: A12345678 |
0.10 |
Removed |
InPassportRecognizer |
indian_passport: A1234567 |
0.10 |
Removed |
ItDriverLicenseRecognizer |
patente: AB1234567C |
0.20 |
Removed |
ItIdentityCardRecognizer |
carta_identita: AA12345BC |
0.01 |
Removed |
ItPassportRecognizer |
passaporto: AB1234567 |
0.01 |
Removed |
These are synthetic, format-plausible examples; actual document issuance is unverified.
Parent epic: #33827. Related recognizer validation issue: #34347.
To Reproduce
At OpenMetadata commit ba688d605830bb3d287ab65e8096b3b4724ce198, load the shipped piiTagsWithRecognizers.json into the default TagProcessor. Pass each column name and value above to create_column_tag_labels. Use workflow language en for the first two rows and it for the remaining rows.
The fixed-sample processor invocation is:
processor = TagProcessor(
config=workflow_config,
metadata=mock_metadata,
classification_manager=manager_loaded_from_shipped_pii_seed,
)
column = Column(
name=column_name,
fullyQualifiedName=f"fixed.db.schema.table.{column_name}",
dataType=DataType.VARCHAR,
)
labels = processor.create_column_tag_labels(column, [sample_value])With the shipped configuration, labels is empty for all five rows. The full reproducible setup should be included with the regression test in the PR.
Expected behavior
Document evidence should be able to reach classification when its format and available context justify it. The PR should state the intended behavior of each recognizer under a matching name and a neutral name before changing scores.
Actual behavior and cause
split_column_name supplies tokens from the column name. Each example above has a token matching its recognizer's context (passport, patente, carta, or passaporto). The name match is therefore not the failing step.
The OpenMetadata boost wrapper skips results below 0.3; the per-recognizer 0.6 filter then removes them. If boost eligibility alone were relaxed for one of these recognizers, a matching column context would raise its result to 1.0 before filtering. Merely moving the 0.6 filter after Presidio's default context enhancer would not suffice: its +0.35, minimum 0.4 rule would leave these raw scores at approximately 0.40–0.55, still below 0.6.
The default workflow's later 0.8 confidence gate receives no intended document evidence. The relevant code is in ingestion/src/metadata/pii/algorithms/presidio_utils.py (MIN_SCORE_FOR_ENHANCEMENT, context enhancement, threshold filter), ingestion/src/metadata/pii/algorithms/presidio_recognizer_factory.py (decorator order), and ingestion/src/metadata/pii/tag_analyzer.py (column-name context).
Proposed change
Repair each recognizer's score and context contract without lowering shared thresholds globally. Options include a recognizer-specific base score or boost eligibility rule, or stronger document-specific evidence. Evaluate each option against false positives before choosing it; lowering a recognizer threshold alone may still leave the result below the workflow's 0.8 gate.
Include the US passport's nine-digit pattern (0.05) in this investigation. It collides with other numeric identifiers and should not become an unconditional passport match.
Acceptance criteria
- Record each recognizer's raw score, context words, configured threshold, and result under matching and neutral column names before and after the change.
- With the appropriate workflow language, each positive example contributes evidence from its intended recognizer and produces the expected final tag when the agreed evidence policy is met.
- Test ordinary SKUs, invoice numbers, booking references, and internal two-letter/seven-digit IDs as negative controls. Do not accept a tag from another recognizer as proof that the document recognizer works. For example, a nine-digit passport-shaped test value was previously tagged through
AbaRoutingRecognizer, while its passport result was absent. - Test both US passport formats and both spaced and unspaced Indian passport formats.
- Test column-name variants including
carta_identita,cartaIdentità, andpassport_no. The current examples already match context; these variants check the broader naming behavior. - Deliberately test the overlap:
AB1234567matches both the Italian passport pattern and the paper identity-card pattern. Underpassaporto, verify that passport evidence survives and document whether identity-card evidence also survives and which recognizer is attributed to the tag. Do not require a unique passport determination from that value under a neutral name without additional evidence. - Verify the final
TagProcessortag and recognizer-level evidence. Changes to one family must not regress the others.
Source: open-metadata/OpenMetadata