249 lines
7.2 KiB
YAML
249 lines
7.2 KiB
YAML
# =====================================================================
|
|
# CONFIGURATION PRESIDIO - v24 (CORRIGÉE ET COMPLÉTÉE)
|
|
# =====================================================================
|
|
supported_languages: [en, fr]
|
|
|
|
# 1. CONFIGURATION DU MOTEUR NLP
|
|
# =====================================================================
|
|
nlp_configuration:
|
|
nlp_engine_name: spacy
|
|
models:
|
|
- lang_code: en
|
|
model_name: en_core_web_lg
|
|
- lang_code: fr
|
|
model_name: fr_core_news_lg
|
|
ner_model_configuration:
|
|
labels_to_ignore:
|
|
- MISC
|
|
- CARDINAL
|
|
- EVENT
|
|
- LANGUAGE
|
|
- LAW
|
|
- ORDINAL
|
|
- PERCENT
|
|
- PRODUCT
|
|
- QUANTITY
|
|
- WORK_OF_ART
|
|
confidence_thresholds:
|
|
DEFAULT_CONFIDENCE: 0.65
|
|
PERSON: 0.85
|
|
LOCATION: 0.4
|
|
ORGANIZATION: 0.55
|
|
|
|
# 2. CONFIGURATION DU REGISTRE DES DÉTECTEURS
|
|
# =====================================================================
|
|
recognizer_registry:
|
|
load_predefined_recognizers: true
|
|
|
|
recognizers:
|
|
# --- 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])[-/.](0[1-9]|1[012])[-/.](19|20)\\d{2}\\b"
|
|
score: 1.0
|
|
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"]
|
|
|
|
# --- 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
|
|
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"]
|
|
|
|
- name: SWIFTRecognizer
|
|
supported_language: fr
|
|
supported_entity: SWIFT_CODE
|
|
patterns:
|
|
- name: BIC/SWIFT Code
|
|
regex: "\\b[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?\\b"
|
|
# CORRIGÉ : Le score est maintenant à 1.0 pour éviter les conflits
|
|
score: 1.0
|
|
context: ["bic", "swift"]
|
|
|
|
- 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"]
|
|
|
|
# --- AJOUTÉ : Détecteur pour les Titres de Fonction ---
|
|
- name: JobTitleRecognizer
|
|
supported_language: fr
|
|
supported_entity: JOB_TITLE
|
|
patterns:
|
|
- name: Common Job Titles
|
|
regex: "(?i)\\b(Gérant|Directeur des Investissements|Directeur|Président)\\b"
|
|
score: 0.9
|
|
context: ["Par :", "Représentée par :"]
|
|
|
|
# --- AJOUTÉ : Détecteur pour les Montants Financiers ---
|
|
- name: MoneyRecognizer
|
|
supported_language: fr
|
|
supported_entity: MONEY
|
|
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"]
|
|
|
|
# --- 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
|
|
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
|
|
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:
|
|
- Adresse
|
|
- ADRESSE
|
|
- Contrat
|
|
- Document
|
|
- Société
|
|
- Investisseur
|
|
- Montant
|
|
- Prêt
|
|
- Intérêt
|
|
- Partie
|
|
- Parties
|
|
- Annexe
|
|
- Remboursement
|
|
- Conversion
|
|
- Financement
|
|
- Sortie
|
|
- "Juste Valeur Marchande"
|
|
- Échéance
|
|
- Clause
|
|
- Clauses
|
|
- Principe
|
|
- Coûts
|
|
- Notifications
|
|
- Article
|
|
- Paragraphe
|
|
- Directeur
|
|
- Gérant
|
|
- Président
|
|
- DocuSign
|
|
- SPRL
|
|
- SA
|
|
- Loi
|
|
- Code
|
|
- Règlement
|
|
- Décret
|
|
- Arrêté
|
|
- Euro
|
|
- EUR
|
|
- Euros
|
|
- Taux
|
|
- Valeur
|
|
- Prix
|
|
- CONTRAT
|
|
- PROJET
|
|
- CONSEILS
|
|
- PARTIES
|
|
- DOCUMENT
|
|
- DEMANDER
|
|
- CONSEILLERS
|
|
- QUALIFIÉS
|
|
- ÉVALUER
|
|
- IMPLICATIONS
|
|
- UTILISATION
|
|
- ATTENDU
|
|
- QUE
|
|
- OBLIGATION
|
|
- QUALIFIÉ
|
|
- TAXES
|
|
- DROITS
|
|
- INFORMATION
|
|
- DISPOSITIONS
|
|
- DIVERSES
|
|
|
|
# 4. CONFIGURATION DES TRANSFORMATIONS D'ANONYMISATION
|
|
# =====================================================================
|
|
anonymizer_config:
|
|
default_anonymizers:
|
|
# 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
|
|
|
|
# Entités détectées par nos règles personnalisées
|
|
CUSTOM_DATE: replace
|
|
CREDIT_CARD_NUMBER: replace
|
|
EMAIL_ADDRESS: replace
|
|
IBAN: replace
|
|
BE_ENTERPRISE_NUMBER: replace
|
|
BE_NATIONAL_REGISTER_NUMBER: replace
|
|
FR_SOCIAL_SECURITY_NUMBER: replace
|
|
SWIFT_CODE: replace
|
|
BE_PHONE_NUMBER: replace
|
|
# AJOUTÉ
|
|
JOB_TITLE: replace
|
|
MONEY: replace
|
|
|
|
replacements:
|
|
PERSON: "<PERSONNE>"
|
|
LOCATION: "<LIEU>"
|
|
ORGANIZATION: "<ORGANISATION>"
|
|
DATE_TIME: "<DATE>"
|
|
CUSTOM_DATE: "<DATE>"
|
|
CREDIT_CARD_NUMBER: "<NUMERO_CARTE_BANCAIRE>"
|
|
EMAIL_ADDRESS: "<EMAIL>"
|
|
IBAN: "<IBAN>"
|
|
BE_ENTERPRISE_NUMBER: "<NUM_ENTREPRISE_BE>"
|
|
BE_NATIONAL_REGISTER_NUMBER: "<NRN_BELGE>"
|
|
FR_SOCIAL_SECURITY_NUMBER: "<NUM_SECU_FR>"
|
|
SWIFT_CODE: "<CODE_SWIFT>"
|
|
BE_PHONE_NUMBER: "<BE_PHONE_NUMBER>"
|
|
# AJOUTÉ
|
|
JOB_TITLE: "<FONCTION>"
|
|
MONEY: "<MONTANT>"
|