Skip to content

Vision proposal: worldwide language and locale coverage #34

Description

@mazzasaverio

Vision proposal: worldwide language and locale coverage

Follow-up to #33, but bigger in scope, so it deserves its own discussion. The proposal: make "works for any language and any country" an explicit roadmap goal, reached in stages instead of ad hoc.

What the core already gives us

A useful part of the work is already language-agnostic by design: email, IBAN, payment card, IP, and URL credential detection are structural, normalization uses NFKC + casefold, and the adversarial corpus already covers RTL/BiDi text. There is even a German corpus (tests/corpus/de.jsonl) acting as a seed. What is missing is the country- and language-specific layer.

Staged plan

  1. Locale identifier framework. Decide once how country packs plug in (this generalizes the core-vs-extension question asked in Proposal: Italian identifier detectors, ONNX long-text handling, and next contributions #33): naming, entity types (e.g. a generic NATIONAL_ID / TAX_ID rather than one enum member per country), detector registration, and how packs are discovered and documented.
  2. Country identifier packs, prioritized by demand: national IDs and tax numbers with checksum validation wherever the spec allows it (codice fiscale, NIE/DNI, NINo, Steuer-ID, CPF, SSN patterns, etc.). Checksum-first keeps the zero-false-positive philosophy of the existing Luhn/mod-97 validators.
  3. Phone realism per region. The current heuristic is deliberately conservative; a per-country prefix/length table (still stdlib-only, no external deps) could raise recall without hurting precision.
  4. Multilingual ML guidance. The ONNX backend is model-agnostic, so multilingual coverage is mostly a documentation and label-mapping problem: document tested multilingual NER models, extend the label-suffix mapping beyond CoNLL/Ai4Privacy where needed, and state clearly which languages a given setup covers.
  5. Per-language test corpora. Grow the tests/corpus/ set (synthetic only, as per the release gates) one language at a time, so every claimed language is actually tested.

Design questions

  • Do you want locale packs in the core (stdlib-only detectors seem compatible with the zero-dependency rule) or as external pseudonymize-locale-* packages listed in the docs?
  • One generic entity type per category (NATIONAL_ID, TAX_ID) or country-specific types? The first keeps the enum stable; the second gives finer policies.
  • Which 3-5 countries first? I would start from where users actually are (EU first, given the regulatory pull).

I am happy to do the implementation work in the usual one-PR-per-item style once the framework decision is made.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions