From c3ea700decba852e33a63f7e090cee4565bc6201 Mon Sep 17 00:00:00 2001 From: Nacim Date: Tue, 24 Jun 2025 00:29:31 +0200 Subject: [PATCH] Update default.yaml --- conf/default.yaml | 123 ++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 76 deletions(-) diff --git a/conf/default.yaml b/conf/default.yaml index 0a9e6e6..14a6814 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -1,5 +1,5 @@ # ===================================================================== -# CONFIGURATION PRESIDIO - v14 (FINALE ET COMPLÈTE) +# CONFIGURATION PRESIDIO - v17 (FINALE, COMPLÈTE ET CORRIGÉE) # ===================================================================== supported_languages: [en, fr] @@ -36,43 +36,37 @@ recognizer_registry: load_predefined_recognizers: true recognizers: - # --- DÉTECTEURS FIABLES ET PRÉCIS UNIQUEMENT --- + # --- DÉTECTEURS FIABLES ET PRÉCIS --- - name: CustomDateRecognizer supported_language: fr supported_entity: CUSTOM_DATE patterns: - - name: Date JJ MM 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 JJ/MM/AAAA regex: "\\b(0[1-9]|[12][0-9]|3[01])[-/.](0[1-9]|1[012])[-/.](19|20)\\d{2}\\b" score: 1.0 - context: ["date", "conclu le", "fait le", "né le"] + context: ["date de naissance", "né le"] + + - name: EmailRecognizer + supported_language: fr + 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}] + context: ["email", "courriel", "mail"] - name: PhoneRecognizer supported_language: fr supported_entity: PHONE_NUMBER patterns: - - name: Phone Pattern Flexible - regex: "\\b(?:\\+|00)(?:32|33)\\s?[1-9](?:[\\s.-]?\\d{1,3}){2,4}\\b" - score: 0.9 - context: ["téléphone", "tel", "mobile", "gsm", "contact"] - - - name: CreditCardRecognizer - supported_language: fr - supported_entity: CREDIT_CARD_NUMBER - patterns: - - name: Credit Card with spaces - regex: "\\b(?:4[0-9]{3}(?:[ -]?[0-9]{4}){3}|5[1-5][0-9]{2}(?:[ -]?[0-9]{4}){3})\\b" + - name: Phone Pattern Flexible (BE/FR) + regex: "\\b(?:\\+|00)(32|33)[\\s.-]?\\d(?:[\\s.-]?\\d{2,3}){2,3}\\b" score: 0.95 - context: ["carte bancaire", "visa", "mastercard"] - + context: ["téléphone", "tel"] + - name: IbanRecognizer supported_language: fr 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}] - context: ["iban", "compte", "bancaire"] + context: ["iban", "compte"] - name: SWIFTRecognizer supported_language: fr @@ -83,16 +77,27 @@ recognizer_registry: score: 1.0 context: ["bic", "swift"] - - name: MoneyRecognizer + - name: SmartOrganizationRecognizer supported_language: fr - supported_entity: MONEY + supported_entity: ORGANIZATION patterns: - - name: Money Pattern EUR - regex: "(?:EUR|€)\\s*\\d{1,3}(?:[.,\\s]\\d{3})*(?:[.,]\\d{2})?|\\d{1,3}(?:[.,\\s]\\d{3})*(?:[.,]\\d{2})?\\s*(?:EUR|€)" - score: 0.9 - context: ["montant", "prix", "eur", "euros"] - - # --- NUMÉROS D'IDENTIFICATION --- + - 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"] + + - 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 + supported_language: fr + 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}] + context: ["registre national"] + - name: FrenchINSEERecognizer supported_language: fr supported_entity: FR_SOCIAL_SECURITY_NUMBER @@ -101,50 +106,12 @@ recognizer_registry: 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"] - - - name: BelgianNRNRecognizer - supported_language: fr - 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}] - context: ["registre national", "nrn", "niss"] - - - 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", "btw", "tva", "BCE", "KBO"] - - + # 3. LISTE D'EXCLUSION (ALLOW LIST) # ===================================================================== allow_list: - Adresse - ADRESSE - - CONTRAT - - PROJET - - CONSEILS - - PARTIES - - DOCUMENT - - DEMANDER - - CONSEILLERS - - QUALIFIÉS - - ÉVALUER - - IMPLICATIONS - - UTILISATION - - ATTENDU - - QUE - - OBLIGATION - - CONVERSION - - FINANCEMENT - - QUALIFIÉ - - PRIX - - SORTIE - - TAXES - - DROITS - - INFORMATION - - DISPOSITIONS - - DIVERSES - - NOTIFICATIONS - Contrat - Document - Société @@ -156,13 +123,16 @@ allow_list: - Parties - Annexe - Remboursement + - Conversion - Financement + - Sortie - "Juste Valeur Marchande" - Échéance - Clause - Clauses - Principe - Coûts + - Notifications - Article - Paragraphe - Directeur @@ -181,26 +151,27 @@ allow_list: - Euros - Taux - Valeur + - Prix # 4. CONFIGURATION DES TRANSFORMATIONS D'ANONYMISATION # ===================================================================== anonymizer_config: default_anonymizers: - # Entités détectées par l'IA (Spacy) + # Entités détectées par l'IA (Spacy) et les règles de base de Presidio PERSON: replace LOCATION: replace ORGANIZATION: replace - DATE_TIME: replace # Détecteur par défaut de Presidio - + DATE_TIME: replace + CREDIT_CARD_NUMBER: replace # Détecteur par défaut de Presidio + MONEY: replace # Détecteur par défaut de Presidio + # Entités détectées par nos règles personnalisées CUSTOM_DATE: replace - CREDIT_CARD_NUMBER: replace - EMAIL_ADDRESS: replace # Détecteur par défaut, mais notre règle peut prendre le dessus + EMAIL_ADDRESS: replace PHONE_NUMBER: replace IBAN: replace - MONEY: replace - BE_NATIONAL_REGISTER_NUMBER: replace BE_ENTERPRISE_NUMBER: replace + BE_NATIONAL_REGISTER_NUMBER: replace FR_SOCIAL_SECURITY_NUMBER: replace SWIFT_CODE: replace @@ -211,11 +182,11 @@ anonymizer_config: DATE_TIME: "" CUSTOM_DATE: "" CREDIT_CARD_NUMBER: "" + MONEY: "" EMAIL_ADDRESS: "" PHONE_NUMBER: "" IBAN: "" - MONEY: "" - BE_NATIONAL_REGISTER_NUMBER: "" BE_ENTERPRISE_NUMBER: "" + BE_NATIONAL_REGISTER_NUMBER: "" FR_SOCIAL_SECURITY_NUMBER: "" SWIFT_CODE: ""