Actualiser conf/default.yaml

This commit is contained in:
2025-07-28 16:14:06 +00:00
parent 06b5f403b8
commit 0ebe8ed939

View File

@@ -1,9 +1,9 @@
# ===================================================================== # =====================================================================
# CONFIGURATION PRESIDIO - v24 (COMPLÈTE, AVEC VOTRE REGEX TÉLÉPHONE) # CONFIGURATION PRESIDIO - v24-AMELIOREE (Base fonctionnelle + Détection puissante)
# ===================================================================== # =====================================================================
supported_languages: [en, fr] supported_languages: [en, fr]
# 1. CONFIGURATION DU MOTEUR NLP # 1. CONFIGURATION DU MOTEUR NLP (INCHANGÉ)
# ===================================================================== # =====================================================================
nlp_configuration: nlp_configuration:
nlp_engine_name: spacy nlp_engine_name: spacy
@@ -30,87 +30,103 @@ nlp_configuration:
LOCATION: 0.4 LOCATION: 0.4
ORGANIZATION: 0.55 ORGANIZATION: 0.55
# 2. CONFIGURATION DU REGISTRE DES DÉTECTEURS # 2. CONFIGURATION DU REGISTRE DES DÉTECTEURS (C'est ici que les améliorations sont faites)
# ===================================================================== # =====================================================================
recognizer_registry: recognizer_registry:
load_predefined_recognizers: true load_predefined_recognizers: true
recognizers: recognizers:
# --- DÉTECTEURS FIABLES ET PRÉCIS --- # --- [AMÉLIORÉ] Détecteur de dates pour capturer "15 mars 2025" ET "12/08/1978" ---
- name: CustomDateRecognizer - name: FlexibleDateRecognizer
supported_language: fr supported_language: fr
supported_entity: CUSTOM_DATE supported_entity: FLEXIBLE_DATE
patterns: patterns:
- name: Date JJ/MM/AAAA - name: Date format JJ mois AAAA
regex: "\\b(0?[1-9]|[12][0-9]|3[01])\\s+(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)\\s+(19|20)\\d{2}\\b"
score: 1.0
- name: Date format JJ/MM/AAAA
regex: "\\b(0[1-9]|[12][0-9]|3[01])[-/.](0[1-9]|1[012])[-/.](19|20)\\d{2}\\b" regex: "\\b(0[1-9]|[12][0-9]|3[01])[-/.](0[1-9]|1[012])[-/.](19|20)\\d{2}\\b"
score: 1.0 score: 1.0
context: ["date de naissance", "né le"] context: ["date", "né le", "signé le", "incident du"]
# --- [NOUVEAU] Détecteur d'adresses belges complètes ---
- name: BelgianAddressRecognizer
supported_language: fr
supported_entity: BE_ADDRESS
patterns:
- name: Adresse Belge complète
regex: "\\b(?:\\d{1,4}[A-Za-z]?(?:\\s*,)?\\s+)?(?:Avenue|Rue|Boulevard|Chaussée|Place|Quai|Impasse|Drève)(?:\\s+(?:de|la|le|d'|des))?(?:\\s+[A-Z][a-zà-ÿ'-]+)+,?(?:\\s+\\d{1,4}[A-Za-z]?)?,\\s*\\d{4}\\s+[A-Za-zà-ÿ'-]+"
score: 1.0
context: ["demeurant", "adresse", "siège social", "bureaux situés"]
# --- [AMÉLIORÉ] Détecteur de téléphone pour fixe (02/...) ET mobile (04xx) ---
- name: BelgianPhoneRecognizer
supported_language: fr
supported_entity: BE_PHONE_NUMBER
patterns:
- name: Numéro téléphone Belge (fixe ou mobile)
regex: "\\b0[1-9](?:[./\\s]?\\d{2,3}){3}\\b"
score: 0.95
context: ["Tel", "Tél", "téléphone", "gsm", "mobile"]
# --- [AMÉLIORÉ] Détecteur de numéro d'entreprise SANS le préfixe "BE" obligatoire ---
- name: BelgianEnterpriseRecognizer
supported_language: fr
supported_entity: BE_ENTERPRISE_NUMBER
patterns:
- name: Numéro BCE/TVA Belge (avec ou sans BE)
regex: "\\b(BE)?\\s?0?\\d{3}[\\.\\s]?\\d{3}[\\.\\s]?\\d{3}\\b"
score: 1.0
context: ["BCE", "TVA", "intracommunautaire"]
# --- [AMÉLIORÉ] Détecteur d'organisation pour "SPRL DigitalConsult" ---
- name: SmartOrganizationRecognizer
supported_language: fr
supported_entity: ORGANIZATION
patterns:
- name: Nom + Forme légale (DigitalConsult SPRL)
regex: "\\b([A-Z][a-zà-ÿ]+(?:\\s[A-Z][a-zà-ÿ]+)*)\\s+(SPRL|SRL|SA|SCS|SNC)\\b"
score: 0.9
- name: Forme légale + Nom (SPRL DigitalConsult)
regex: "\\b(SPRL|SRL|SA|SCS|SNC)\\s+([A-Z][a-zà-ÿ]+(?:\\s[A-Z][a-zà-ÿ]+)*)\\b"
score: 0.9
context: ["société", "entreprise", "gérant de la"]
# --- [NOUVEAU] Détecteur pour les banques ---
- name: BankOrganizationRecognizer
supported_language: fr
supported_entity: ORGANIZATION
supported_tokens: ["BNP Paribas Fortis", "CBC Banque"]
score: 0.95
# --- [NOUVEAU] Détecteur pour l'ID professionnel "n° IEC: 567890" ---
- name: ProfessionalIdRecognizer
supported_language: fr
supported_entity: BE_PRO_ID
patterns:
- name: Numéro IEC
regex: "(n°\\sIEC:?|IEC:?)\\s*\\d{6}"
score: 1.0
context: ["expert-comptable"]
# --- Détecteurs de votre fichier initial qui étaient déjà corrects ---
- name: EmailRecognizer - name: EmailRecognizer
supported_language: fr supported_language: fr
supported_entity: EMAIL_ADDRESS supported_entity: EMAIL_ADDRESS
patterns: [{name: Email Pattern, regex: "\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b", score: 1.0}] patterns: [{name: Email Pattern, regex: "\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b", score: 1.0}]
context: ["email", "courriel", "mail"] context: ["email", "courriel", "mail"]
# --- VOTRE REGEX TÉLÉPHONE, ADAPTÉE POUR PRESIDIO ---
- name: CustomBelgianPhoneRecognizer
supported_language: fr
supported_entity: BE_PHONE_NUMBER
patterns:
- name: Belgian Phone Pattern (votre regex adaptée)
# J'ai doublé les backslashes et remplacé ^/$ par \b
regex: "\\b(((\\+|00)32[ ]?(?:\\(0\\)[ ]?)?)|0)?4\\d{2}(\\s?\\d{2}[\\s\\.]?){3}\\b"
score: 1.0
context: ["téléphone", "tel", "gsm", "mobile"]
- name: CustomCreditCardRecognizer
supported_language: fr
supported_entity: CREDIT_CARD_NUMBER
patterns:
- name: Credit Card with spaces (Visa, Mastercard)
regex: "\\b(?:4[0-9]{3}(?:[ -]?[0-9]{4}){3}|5[1-5][0-9]{2}(?:[ -]?[0-9]{4}){3})\\b"
score: 0.95
context: ["carte", "visa", "mastercard"]
- name: IbanRecognizer - name: IbanRecognizer
supported_language: fr supported_language: fr
supported_entity: IBAN supported_entity: IBAN
patterns: [{name: IBAN Pattern, regex: "\\b[A-Z]{2}[0-9]{2}\\s?(?:[A-Z0-9]{4}\\s?){2,7}[A-Z0-9]{1,4}\\b", score: 0.95}] patterns: [{name: IBAN Pattern, regex: "\\b[A-Z]{2}[0-9]{2}\\s?(?:[A-Z0-9]{4}\\s?){2,7}[A-Z0-9]{1,4}\\b", score: 0.95}]
context: ["iban", "compte"] context: ["iban", "compte"]
- name: SmartOrganizationRecognizer
supported_language: fr
supported_entity: ORGANIZATION
patterns:
- name: Company Name with Legal Form
regex: "\\b([A-Z][a-zà-ÿ]+(?:\\s[A-Z][a-zà-ÿ]+)*)\\s+(SPRL|SARL|SA|SCS|SNC)\\b"
score: 1.0
context: ["société", "entreprise"]
# --- NUMÉROS D'IDENTIFICATION ---
- name: BelgianEnterpriseRecognizer
supported_language: fr
supported_entity: BE_ENTERPRISE_NUMBER
patterns: [{name: BE Enterprise Number, regex: "\\bBE\\s?0\\d{3}[\\.\\s]?\\d{3}[\\.\\s]?\\d{3}\\b", score: 0.95}]
context: ["numéro d'entreprise", "BCE"]
- name: BelgianNRNRecognizer - name: BelgianNRNRecognizer
supported_language: fr supported_language: fr
supported_entity: BE_NATIONAL_REGISTER_NUMBER supported_entity: BE_NATIONAL_REGISTER_NUMBER
patterns: [{name: NRN Pattern, regex: "\\b[0-9]{2}\\.[0-9]{2}\\.[0-9]{2}-[0-9]{3}\\.[0-9]{2}\\b", score: 1.0}] patterns: [{name: NRN Pattern, regex: "\\b[0-9]{2}\\.[0-9]{2}\\.[0-9]{2}-[0-9]{3}\\.[0-9]{2}\\b", score: 1.0}]
context: ["registre national"] context: ["registre national"]
- name: FrenchINSEERecognizer # 3. LISTE D'EXCLUSION (ALLOW LIST) (INCHANGÉ)
supported_language: fr
supported_entity: FR_SOCIAL_SECURITY_NUMBER
patterns:
- name: INSEE Pattern with flexible spaces
regex: "\\b[12]\\s*[0-9]{2}\\s*(?:0[1-9]|1[0-2])\\s*(?:2[ABab]|[0-9]{2})\\s*[0-9]{3}\\s*[0-9]{3}[\\s]?[0-9]{2}\\b"
score: 0.95
context: ["sécurité sociale", "insee", "nir"]
# 3. LISTE D'EXCLUSION (ALLOW LIST)
# ===================================================================== # =====================================================================
allow_list: allow_list:
- Adresse - Adresse
@@ -156,40 +172,41 @@ allow_list:
- Valeur - Valeur
- Prix - Prix
# 4. CONFIGURATION DES TRANSFORMATIONS D'ANONYMISATION # 4. CONFIGURATION DES TRANSFORMATIONS D'ANONYMISATION (Légèrement complété)
# ===================================================================== # =====================================================================
anonymizer_config: anonymizer_config:
default_anonymizers: default_anonymizers:
# Entités détectées par l'IA (Spacy) et les règles de base de Presidio # Entités existantes
PERSON: replace PERSON: replace
LOCATION: replace LOCATION: replace
ORGANIZATION: replace ORGANIZATION: replace
DATE_TIME: replace DATE_TIME: replace
MONEY: replace MONEY: replace
# Entités détectées par nos règles personnalisées
CUSTOM_DATE: replace
CREDIT_CARD_NUMBER: replace
EMAIL_ADDRESS: replace EMAIL_ADDRESS: replace
IBAN: replace IBAN: replace
BE_ENTERPRISE_NUMBER: replace BE_ENTERPRISE_NUMBER: replace
BE_NATIONAL_REGISTER_NUMBER: replace BE_NATIONAL_REGISTER_NUMBER: replace
FR_SOCIAL_SECURITY_NUMBER: replace
SWIFT_CODE: replace
BE_PHONE_NUMBER: replace BE_PHONE_NUMBER: replace
# [NOUVEAU] Ajout des nouvelles entités à anonymiser
FLEXIBLE_DATE: replace
BE_ADDRESS: replace
BE_PRO_ID: replace
IP_ADDRESS: replace # Important pour anonymiser l'adresse IP
replacements: replacements:
# Remplacements existants
PERSON: "<PERSONNE>" PERSON: "<PERSONNE>"
LOCATION: "<LIEU>" LOCATION: "<LIEU>"
ORGANIZATION: "<ORGANISATION>" ORGANIZATION: "<ORGANISATION>"
DATE_TIME: "<DATE>" DATE_TIME: "<DATE>"
CUSTOM_DATE: "<DATE>"
CREDIT_CARD_NUMBER: "<NUMERO_CARTE_BANCAIRE>"
MONEY: "<MONTANT>" MONEY: "<MONTANT>"
EMAIL_ADDRESS: "<EMAIL>" EMAIL_ADDRESS: "<EMAIL>"
IBAN: "<IBAN>" IBAN: "<IBAN>"
BE_ENTERPRISE_NUMBER: "<NUM_ENTREPRISE_BE>" BE_ENTERPRISE_NUMBER: "<NUM_ENTREPRISE_BE>"
BE_NATIONAL_REGISTER_NUMBER: "<NRN_BELGE>" BE_NATIONAL_REGISTER_NUMBER: "<NRN_BELGE>"
FR_SOCIAL_SECURITY_NUMBER: "<NUM_SECU_FR>" BE_PHONE_NUMBER: "<TELEPHONE_BE>"
SWIFT_CODE: "<CODE_SWIFT>" # [NOUVEAU] Ajout des remplacements pour les nouvelles entités
BE_PHONE_NUMBER: "<BE_PHONE_NUMBER>" FLEXIBLE_DATE: "<DATE>"
BE_ADDRESS: "<ADRESSE_BELGE>"
BE_PRO_ID: "<ID_PROFESSIONNEL>"
IP_ADDRESS: "<ADRESSE_IP>"