Update default.yaml
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# =====================================================================
|
# =====================================================================
|
||||||
# CONFIGURATION PRESIDIO - v4 (PROPRE ET AFFINÉE)
|
# CONFIGURATION PRESIDIO - v6 (PUISSANCE MAXIMALE)
|
||||||
# =====================================================================
|
# =====================================================================
|
||||||
supported_languages: [en, fr]
|
supported_languages: [en, fr]
|
||||||
|
|
||||||
@@ -11,7 +11,8 @@ nlp_configuration:
|
|||||||
- lang_code: en
|
- lang_code: en
|
||||||
model_name: en_core_web_lg
|
model_name: en_core_web_lg
|
||||||
- lang_code: fr
|
- lang_code: fr
|
||||||
model_name: fr_core_news_lg
|
# MODIFIÉ : Passage au modèle le plus large et le plus précis
|
||||||
|
model_name: fr_core_news_lg
|
||||||
ner_model_configuration:
|
ner_model_configuration:
|
||||||
labels_to_ignore:
|
labels_to_ignore:
|
||||||
- MISC
|
- MISC
|
||||||
@@ -24,12 +25,11 @@ nlp_configuration:
|
|||||||
- PRODUCT
|
- PRODUCT
|
||||||
- QUANTITY
|
- QUANTITY
|
||||||
- WORK_OF_ART
|
- WORK_OF_ART
|
||||||
# Abaisser le seuil pour les entités qui n'étaient pas détectées
|
|
||||||
confidence_thresholds:
|
confidence_thresholds:
|
||||||
DEFAULT_CONFIDENCE: 0.65
|
DEFAULT_CONFIDENCE: 0.65
|
||||||
PERSON: 0.85
|
PERSON: 0.85
|
||||||
LOCATION: 0.4 # MODIFIÉ : Accepte les adresses même avec une faible confiance
|
LOCATION: 0.4
|
||||||
DATE_TIME: 0.4 # MODIFIÉ : Accepte les dates même avec une faible confiance
|
DATE_TIME: 0.4
|
||||||
ORGANIZATION: 0.7
|
ORGANIZATION: 0.7
|
||||||
|
|
||||||
# 2. CONFIGURATION DU REGISTRE DES DÉTECTEURS
|
# 2. CONFIGURATION DU REGISTRE DES DÉTECTEURS
|
||||||
@@ -38,47 +38,25 @@ recognizer_registry:
|
|||||||
load_predefined_recognizers: true
|
load_predefined_recognizers: true
|
||||||
|
|
||||||
recognizers:
|
recognizers:
|
||||||
# --- DÉTECTEURS EXISTANTS ---
|
# --- DÉTECTEURS FONDAMENTAUX ---
|
||||||
|
- name: CustomDateRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: CUSTOM_DATE
|
||||||
|
patterns:
|
||||||
|
- name: Date DD/MM/YYYY
|
||||||
|
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"]
|
||||||
- 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"]
|
||||||
|
|
||||||
- name: PhoneRecognizer
|
- name: PhoneRecognizer
|
||||||
supported_language: fr
|
supported_language: fr
|
||||||
supported_entity: PHONE_NUMBER
|
supported_entity: PHONE_NUMBER
|
||||||
patterns: [{name: Phone Pattern (FR/BE/LUX), regex: "\\b(?:(?:\\+|00)?(?:32|33|352)|0)\\s?[1-9](?:[\\s.-]?\\d{2}){3,4}\\b", score: 0.8}]
|
patterns: [{name: Phone Pattern (FR/BE/LUX), regex: "\\b(?:(?:\\+|00)?(?:32|33|352)|0)\\s?[1-9](?:[\\s.-]?\\d{2}){3,4}\\b", score: 0.8}]
|
||||||
context: ["téléphone", "tel", "mobile", "gsm", "contact"]
|
context: ["téléphone", "tel", "mobile", "gsm", "contact"]
|
||||||
|
|
||||||
- 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"]
|
|
||||||
|
|
||||||
- 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"]
|
|
||||||
|
|
||||||
# --- CORRECTION MAJEURE : Règle BIC/SWIFT stricte ---
|
|
||||||
- name: BICRecognizer
|
|
||||||
supported_language: fr
|
|
||||||
supported_entity: BE_BIC
|
|
||||||
patterns:
|
|
||||||
- name: BIC/SWIFT Code
|
|
||||||
regex: "\\b([A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?)\\b"
|
|
||||||
score: 1.0
|
|
||||||
context: ["bic", "swift"]
|
|
||||||
|
|
||||||
- name: JobTitleRecognizer
|
- name: JobTitleRecognizer
|
||||||
supported_language: fr
|
supported_language: fr
|
||||||
supported_entity: JOB_TITLE
|
supported_entity: JOB_TITLE
|
||||||
@@ -88,14 +66,87 @@ recognizer_registry:
|
|||||||
score: 0.8
|
score: 0.8
|
||||||
context: ["représentée par", "fonction", "poste", "attention de"]
|
context: ["représentée par", "fonction", "poste", "attention de"]
|
||||||
|
|
||||||
- name: CompanyFormRecognizer
|
# --- DÉTECTEURS FINANCIERS ---
|
||||||
|
- name: CreditCardRecognizer
|
||||||
supported_language: fr
|
supported_language: fr
|
||||||
supported_entity: LEGAL_FORM
|
supported_entity: CREDIT_CARD_NUMBER
|
||||||
patterns:
|
patterns:
|
||||||
- name: Common Legal Forms
|
- name: Credit Card with spaces
|
||||||
regex: "\\b(SPRL|SA|SCS|SNC|SCRI|SCA|SRL|SC)\\b"
|
regex: "\\b(?:4[0-9]{3}(?:[ -]?[0-9]{4}){3}|5[1-5][0-9]{2}(?:[ -]?[0-9]{4}){3})\\b"
|
||||||
score: 0.9
|
score: 0.95
|
||||||
context: ["société", "entreprise"]
|
context: ["carte bancaire", "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", "bancaire"]
|
||||||
|
- name: BICRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: BE_BIC
|
||||||
|
patterns:
|
||||||
|
- name: BIC/SWIFT Code
|
||||||
|
regex: "\\b([A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?)\\b"
|
||||||
|
score: 1.0
|
||||||
|
context: ["bic", "swift"]
|
||||||
|
|
||||||
|
# --- NUMÉROS D'IDENTIFICATION (FRANCE) ---
|
||||||
|
- 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"]
|
||||||
|
- name: FrenchSIRENSIRETRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: FR_SIREN_SIRET
|
||||||
|
patterns:
|
||||||
|
- {name: SIRET Pattern, regex: "\\b[0-9]{3}[\\s]?[0-9]{3}[\\s]?[0-9]{3}[\\s]?[0-9]{5}\\b", score: 0.9}
|
||||||
|
- {name: SIREN Pattern, regex: "\\b[0-9]{3}[\\s]?[0-9]{3}[\\s]?[0-9]{3}\\b", score: 0.85}
|
||||||
|
context: ["siren", "siret"]
|
||||||
|
- name: FrenchPassportRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: FR_PASSPORT
|
||||||
|
patterns: [{name: French Passport, regex: "\\b[0-9]{2}[A-Z]{2}[0-9]{5}\\b", score: 1.0}]
|
||||||
|
context: ["passeport"]
|
||||||
|
- name: FrenchIDCardRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: FR_ID_CARD_NUMBER
|
||||||
|
patterns: [{name: French CNI, regex: "\\b[0-9]{12}\\b", score: 0.8}]
|
||||||
|
context: ["cni", "carte nationale d'identité"]
|
||||||
|
- name: FrenchLicensePlateRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: FR_LICENSE_PLATE
|
||||||
|
patterns: [{name: French License Plate, regex: "\\b([A-Z]{2}-\\d{3}-[A-Z]{2}|\\d{1,4}\\s[A-Z]{2,3}\\s\\d{2,3})\\b", score: 0.8}]
|
||||||
|
context: ["plaque", "immatriculation"]
|
||||||
|
|
||||||
|
# --- NUMÉROS D'IDENTIFICATION (BELGIQUE) ---
|
||||||
|
- 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"]
|
||||||
|
- name: BelgianIDCardRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: BE_ID_CARD_NUMBER
|
||||||
|
patterns: [{name: "Belgian ID Card Number", regex: "\\b\\d{3}-\\d{7}-\\d{2}\\b", score: 1.0}]
|
||||||
|
context: ["carte d'identité", "eid"]
|
||||||
|
- name: BelgianLicensePlateRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: BE_LICENSE_PLATE
|
||||||
|
patterns: [{name: "Belgian License Plate", regex: "\\b(?:[1-9]-\\w{3}-\\d{3}|\\w{3}-\\d{3})\\b", score: 0.8}]
|
||||||
|
context: ["plaque", "immatriculation"]
|
||||||
|
- name: BelgianPassportRecognizer
|
||||||
|
supported_language: fr
|
||||||
|
supported_entity: BE_PASSPORT
|
||||||
|
patterns: [{name: Belgian Passport, regex: "\\b[A-Z]{2}\\d{6}\\b", score: 1.0}]
|
||||||
|
context: ["passeport"]
|
||||||
|
|
||||||
# 3. LISTE D'EXCLUSION (ALLOW LIST)
|
# 3. LISTE D'EXCLUSION (ALLOW LIST)
|
||||||
# =====================================================================
|
# =====================================================================
|
||||||
@@ -163,41 +214,45 @@ anonymizer_config:
|
|||||||
LOCATION: replace
|
LOCATION: replace
|
||||||
ORGANIZATION: replace
|
ORGANIZATION: replace
|
||||||
DATE_TIME: replace
|
DATE_TIME: replace
|
||||||
|
CUSTOM_DATE: replace
|
||||||
CREDIT_CARD_NUMBER: replace
|
CREDIT_CARD_NUMBER: replace
|
||||||
EMAIL_ADDRESS: replace
|
EMAIL_ADDRESS: replace
|
||||||
IP_ADDRESS: replace
|
|
||||||
PHONE_NUMBER: replace
|
PHONE_NUMBER: replace
|
||||||
URL: replace
|
|
||||||
IBAN: replace
|
IBAN: replace
|
||||||
MONEY: replace
|
MONEY: replace
|
||||||
BE_NATIONAL_REGISTER_NUMBER: replace
|
|
||||||
BE_ENTERPRISE_NUMBER: replace
|
|
||||||
FR_SOCIAL_SECURITY_NUMBER: replace
|
|
||||||
FR_SIREN_SIRET: replace
|
|
||||||
BE_ID_CARD_NUMBER: replace
|
|
||||||
BE_LICENSE_PLATE: replace
|
|
||||||
BE_BIC: replace
|
BE_BIC: replace
|
||||||
JOB_TITLE: replace
|
JOB_TITLE: replace
|
||||||
LEGAL_FORM: replace
|
BE_NATIONAL_REGISTER_NUMBER: replace
|
||||||
|
BE_ENTERPRISE_NUMBER: replace
|
||||||
|
BE_ID_CARD_NUMBER: replace
|
||||||
|
BE_LICENSE_PLATE: replace
|
||||||
|
BE_PASSPORT: replace
|
||||||
|
FR_SOCIAL_SECURITY_NUMBER: replace
|
||||||
|
FR_SIREN_SIRET: replace
|
||||||
|
FR_PASSPORT: replace
|
||||||
|
FR_ID_CARD_NUMBER: replace
|
||||||
|
FR_LICENSE_PLATE: replace
|
||||||
|
|
||||||
replacements:
|
replacements:
|
||||||
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>"
|
CREDIT_CARD_NUMBER: "<NUMERO_CARTE_BANCAIRE>"
|
||||||
EMAIL_ADDRESS: "<EMAIL>"
|
EMAIL_ADDRESS: "<EMAIL>"
|
||||||
IBAN: "<IBAN>"
|
|
||||||
IP_ADDRESS: "<ADRESSE_IP>"
|
|
||||||
PHONE_NUMBER: "<TELEPHONE>"
|
PHONE_NUMBER: "<TELEPHONE>"
|
||||||
URL: "<URL>"
|
IBAN: "<IBAN>"
|
||||||
MONEY: "<MONTANT>"
|
MONEY: "<MONTANT>"
|
||||||
BE_NATIONAL_REGISTER_NUMBER: "<NRN_BELGE>"
|
|
||||||
BE_ENTERPRISE_NUMBER: "<NUM_ENTREPRISE_BE>"
|
|
||||||
FR_SOCIAL_SECURITY_NUMBER: "<NUM_SECU_FR>"
|
|
||||||
FR_SIREN_SIRET: "<SIREN_SIRET_FR>"
|
|
||||||
BE_ID_CARD_NUMBER: "<CARTE_ID_BE>"
|
|
||||||
BE_LICENSE_PLATE: "<PLAQUE_BE>"
|
|
||||||
BE_BIC: "<CODE_BIC>"
|
BE_BIC: "<CODE_BIC>"
|
||||||
JOB_TITLE: "<FONCTION>"
|
JOB_TITLE: "<FONCTION>"
|
||||||
LEGAL_FORM: "<FORME_JURIDIQUE>"
|
BE_NATIONAL_REGISTER_NUMBER: "<NRN_BELGE>"
|
||||||
|
BE_ENTERPRISE_NUMBER: "<NUM_ENTREPRISE_BE>"
|
||||||
|
BE_ID_CARD_NUMBER: "<CARTE_ID_BE>"
|
||||||
|
BE_LICENSE_PLATE: "<PLAQUE_BE>"
|
||||||
|
BE_PASSPORT: "<PASSEPORT_BE>"
|
||||||
|
FR_SOCIAL_SECURITY_NUMBER: "<NUM_SECU_FR>"
|
||||||
|
FR_SIREN_SIRET: "<SIREN_SIRET_FR>"
|
||||||
|
FR_PASSPORT: "<PASSEPORT_FR>"
|
||||||
|
FR_ID_CARD_NUMBER: "<CARTE_ID_FR>"
|
||||||
|
FR_LICENSE_PLATE: "<PLAQUE_FR>"
|
||||||
|
|||||||
Reference in New Issue
Block a user