Aller au contenu
Skillpedia
Sécurité5.8k · #14690

deidentifying-multilingual-text

Ce qu’il fait

Cette compétence retire les identifiants de patients des notes cliniques rédigées dans de nombreuses langues, en utilisant des motifs propres à chaque langue pour les identifiants nationaux et les numéros de téléphone. Elle s'adresse aux équipes qui travaillent avec des dossiers médicaux non anglophones.

Quand l’utiliser

  • ✓Quand les notes cliniques sont rédigées dans une langue autre que l'anglais.
  • ✓Quand les notes contiennent des identifiants nationaux, comme le DNI espagnol ou le CPF brésilien.
  • ✓Quand les valeurs de remplacement fictives doivent paraître naturelles dans la langue de la note.

Lien du skill

https://github.com/maziyarpanahi/openmed/blob/master/skills/deidentifying-multilingual-text/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/maziyarpanahi/openmed/blob/master/skills/deidentifying-multilingual-text/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Ces notes médicales sont en espagnol et contiennent des numéros DNI. Retire les identifiants des patients et garde un texte naturel.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent choisit le modèle de langue et les motifs correspondant à la langue de la note, puis retire ou remplace les identifiants à l'aide de valeurs fictives adaptées à la locale.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

De-identifying multilingual text

OpenMed de-identifies clinical text in many languages, each with a dedicated PII model, language-specific regex patterns (national IDs, phone formats), and a locale-aware surrogate generator. Pass lang= to deidentify / extract_pii and the right model, patterns, and fake-data tables are selected automatically. Everything runs on-device.

When to use this skill

Use it whenever the source text is not English, or when surrogates must look native to the locale (a German note should get German-looking fake names and a valid-format Steuer-ID surrogate, not a US SSN).

Discover supported languages at runtime — don't hardcode

import openmed
from openmed.core.pii_i18n import SUPPORTED_LANGUAGES, get_patterns_for_language

print(sorted(SUPPORTED_LANGUAGES))   # query it; the set is the source of truth
# Language-appropriate default model for a code:
models = openmed.get_pii_models_by_language("es")
# Language-specific regex patterns (national IDs, phones, etc.):
patterns = get_patterns_for_language("de")

The set currently spans English plus European, South Asian, Middle Eastern, and East Asian languages — but always read SUPPORTED_LANGUAGES rather than trusting a number, since it changes as models ship. MCP exposes the same list via openmed_list_pii_languages.

Quick start (Spanish)

import openmed

nota = (
    "El paciente Carlos Hernández (DNI 12345678Z), nacido el 11/04/1979, "
    "vive en Calle Mayor 5, Madrid. Teléfono 612 345 678."
)

result = openmed.deidentify(
    nota,
    lang="es",                # selects the Spanish PII model + ES patterns
    method="replace",         # locale-native fake values
    locale="es_ES",           # Faker locale (defaults from lang via LANG_TO_LOCALE)
)
print(result.deidentified_text)
# El paciente [surrogate name] (DNI [surrogate]), nacido el [date], ...

For German, just switch the code:

befund = "Patientin Anna Müller, geb. 11.04.1979, Steuer-ID 12 345 678 901."
result = openmed.deidentify(befund, lang="de", method="replace")

Workflow

  1. Confirm the language is supported by checking SUPPORTED_LANGUAGES.
  2. Pass lang= to deidentify/extract_pii. This selects the language-specific model (via get_pii_models_by_language) and the regex pattern set (via get_patterns_for_language) for national IDs and formats.
  3. Set locale= for surrogates when method="replace". If omitted, the locale is derived from lang through LANG_TO_LOCALE (e.g. pt→pt_PT). Override for regional variants (pt_BR, en_GB, Gulf/Levant Arabic).
  4. Let accent normalization happen. For models trained on accent-free text (Spanish), deidentify auto-strips diacritics before inference and maps spans back to the original accented text. You normally do not set normalize_accents yourself.
  5. Keep surrogates stable across a document with consistent=True, seed=....

Language-specific national IDs

The pattern sets encode and the validators check real national identifier formats and checksums, so structured IDs are caught even when the model is unsure. Examples available in openmed.core.pii_i18n:

Language Identifier Validator
French NIR / INSEE validate_french_nir
German Steuer-ID validate_german_steuer_id
Italian Codice Fiscale validate_italian_codice_fiscale
Spanish DNI / NIE validate_spanish_dni, validate_spanish_nie
Dutch BSN validate_dutch_bsn
Hindi Aadhaar validate_aadhaar
Portuguese CPF / CNPJ validate_portuguese_cpf, validate_portuguese_cnpj
Turkish TCKN validate_turkish_tckn

These map to OpenMed CANONICAL_LABELS (ID_NUM, SSN) and are redacted by the same policy actions as any other identifier.

Hand-off to / from OpenMed

  • Core de-id: deidentifying-clinical-text — methods, thresholds, keep_mapping, policies (all accept lang/locale).
  • Surrogates: generating-synthetic-surrogates — locale-native fakes and custom providers per language.
  • Policies: configuring-privacy-policies — policy= works with any lang.
  • Audit: auditing-deidentification-runs records the model and language in the no-PHI report.
  • Other surfaces: MCP openmed_deidentify / openmed_list_pii_languages; REST POST /pii/deidentify (both take a language parameter).

Edge cases & gotchas

  • **Never
Questions fréquentes

Quelles langues sont prises en charge ?

La compétence vérifie la liste des langues prises en charge à l'exécution, car cette liste s'allonge avec les nouveaux modèles.

Faut-il une connexion Internet ?

Non. Le traitement s'effectue sur l'appareil, après un téléchargement unique du modèle.

Gère-t-elle les formats d'identifiants nationaux ?

Oui. Elle utilise des motifs propres à chaque langue pour les identifiants nationaux, comme le DNI, le codice fiscale et le CPF.

Détails

Description originale de l’auteur

De-identify non-English clinical text on-device with OpenMed by passing lang= and locale= to deidentify(). Use when the user has Spanish, German, French, Italian, Portuguese, Dutch, Hindi, Telugu, Arabic, Japanese, or Turkish medical notes, needs locale-aware fake surrogates, must handle language-specific national IDs (DNI, NIR, Steuer-ID, codice fiscale, BSN, CPF, TCKN, Aadhaar), or asks which languages OpenMed PII supports. Covers SUPPORTED_LANGUAGES, get_pii_models_by_language, get_patterns_for_language, LANG_TO_LOCALE, and accent normalization. Pairs with OpenMed deidentifying-clinical-tex

repo: maziyarpanahi/openmed

Popularité

Étoiles GitHub
5.8k
Position au classement
#14690
Licence
Apache-2.0
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires