Update default.yaml

This commit is contained in:
Nacim
2025-06-23 11:16:55 +02:00
committed by GitHub
parent 560a7384f7
commit 6b1fc218e7

View File

@@ -13,96 +13,29 @@ models:
# Configuration du comportement du moteur NLP # Configuration du comportement du moteur NLP
ner_model_configuration: ner_model_configuration:
# Ne plus ignorer ORG. On va gérer les faux positifs d'ORG via l'allow_list, c'est plus précis.
labels_to_ignore: labels_to_ignore:
- MISC - MISC
# Seuils de confiance par entité. Augmentés pour réduire les faux positifs.
confidence_threshold: confidence_threshold:
default: 0.6 # Plus strict que 0.35 par défaut default: 0.6
EMAIL_ADDRESS: 0.8 EMAIL_ADDRESS: 0.8
PHONE_NUMBER: 0.8 PHONE_NUMBER: 0.8
PERSON: 0.85 # Très strict pour les noms de personnes PERSON: 0.85
LOCATION: 0.75 # Moins de faux positifs pour les lieux LOCATION: 0.75
MONEY: 0.85 # Nouveau type d'entité pour les montants MONEY: 0.85
# Section où vous définissez vos recognizers personnalisés basés sur des regex
# C'est ici que sont déplacées les définitions de 'ad_hoc_recognizers' de route.ts
recognizers:
- name: BelgianNRNRecognizer
entity_name: BE_NATIONAL_REGISTER_NUMBER
supported_language: fr
patterns:
- name: NRN_Pattern
# Regex plus robuste pour le NRN belge (prend en compte différents formats)
regex: "\\b(?:[0-9]{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01]))-?\\d{3}\\.?\\d{2}\\b"
score: 1.0 # Score très élevé car regex spécifique
- name: BelgianEnterpriseRecognizer
entity_name: BE_ENTERPRISE_NUMBER
supported_language: fr
patterns:
- name: BTW_Pattern
# Regex pour les numéros d'entreprise belges (BE 0XXX.XXX.XXX)
regex: "\\bBE\\s?0\\d{3}[\\.\\s]?\\d{3}[\\.\\s]?\\d{3}\\b"
score: 0.95
- name: IBANRecognizer
entity_name: IBAN
supported_language: fr
patterns:
- name: IBAN_Pattern
# Regex IBAN (plus générique, mais capturera les belges aussi)
regex: "\\b[A-Z]{2}\\d{2}\\s?(?:[A-Z0-9]{4}\\s?){2,7}[A-Z0-9]{1,4}\\b"
score: 0.95
- name: PhoneRecognizer
entity_name: PHONE_NUMBER
supported_language: fr
patterns:
- name: Phone_Pattern
# Regex pour numéros de téléphone belges/français/luxembourgeois
regex: "\\b(?:(?:\\+|00)?(?:32|33|352)|0)\\s?[1-9](?:[\\s.-]?\\d{2}){3,4}\\b"
score: 0.8
- name: EmailRecognizer
entity_name: EMAIL_ADDRESS
supported_language: fr
patterns:
- name: Email_Pattern
# Regex pour les adresses email
regex: "\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b"
score: 1.0
- name: MoneyRecognizer # NOUVEAU : Recognizer pour les montants monétaires
entity_name: MONEY
supported_language: fr
patterns:
- name: Money_Pattern
# Regex pour des formats comme EUR 250.000, 250.000 EUR, 250 000€
regex: "(?:EUR|€)\\s*\\d{1,3}(?:[.,\\s]\\d{3})*(?:[.,]\\d{2})?|\\d{1,3}(?:[.,\\s]\\d{3})*(?:[.,]\\d{2})?\\s*(?:EUR|€)"
score: 0.85
# Configuration des détecteurs (Recognizers) # Configuration des détecteurs (Recognizers)
# CECI EST LA CLÉ : vous listez les noms des recognizers que vous avez définis ci-dessus. # Ici, nous pointons directement vers le module Python que nous venons de créer.
# SUPPRIMEZ : - presidio_config.custom_recognizers.custom_recognizers # Presidio chargera tous les recognizers définis dans ce module.
# AJOUTEZ : Les noms de vos recognizers custom.
recognizer_registry: recognizer_registry:
- default # Gardez toujours 'default' pour les recognizers intégrés de Presidio - default # Charger les détecteurs par défaut de Presidio
- BelgianNRNRecognizer - custom_recognizers # Référence au dossier/module Python 'custom_recognizers'
- BelgianEnterpriseRecognizer
- IBANRecognizer
- PhoneRecognizer
- EmailRecognizer
- MoneyRecognizer # Active le nouveau recognizer MONEY
# Liste des mots à ignorer (faux positifs courants) # Liste des mots à ignorer (faux positifs courants)
# Important: spécifiez le type d'entité si le mot est souvent mal labellisé comme ce type
allow_list: allow_list:
# Termes contractuels/juridiques/financiers génériques souvent mal labellisés # Termes contractuels/juridiques/financiers génériques souvent mal labellisés
- text: Contrat - text: Contrat
type: LOCATION # Si 'Contrat' est souvent vu comme une LOCATION type: LOCATION
- text: contrat - text: contrat
type: LOCATION type: LOCATION
- text: Contrats - text: Contrats
@@ -112,11 +45,11 @@ allow_list:
- text: document - text: document
type: LOCATION type: LOCATION
- text: Société - text: Société
type: PERSON # Si 'Société' est souvent vu comme une PERSON type: PERSON
- text: Investisseur - text: Investisseur
type: PERSON type: PERSON
- text: Montant - text: Montant
type: LOCATION # Si 'Montant' est souvent vu comme une LOCATION. Maintenant aussi MONEY sera détecté. type: LOCATION
- text: Prêt - text: Prêt
type: LOCATION type: LOCATION
- text: Intérêt - text: Intérêt
@@ -126,7 +59,7 @@ allow_list:
- text: Partie - text: Partie
type: LOCATION type: LOCATION
- text: Parties - text: Parties
type: PERSON # Si 'Parties' est souvent vu comme une PERSON type: PERSON
- text: Annexe - text: Annexe
type: LOCATION type: LOCATION
- text: Remboursement - text: Remboursement
@@ -136,9 +69,9 @@ allow_list:
- text: Financement - text: Financement
type: LOCATION type: LOCATION
- text: Sortie - text: Sortie
type: LOCATION # Important, 'Sortie' était mal labellisé type: LOCATION
- text: "Juste Valeur Marchande" - text: "Juste Valeur Marchande"
type: PERSON # Était mal labellisé type: PERSON
- text: Échéance - text: Échéance
type: LOCATION type: LOCATION
- text: Clause - text: Clause
@@ -148,28 +81,27 @@ allow_list:
- text: Principe - text: Principe
type: LOCATION type: LOCATION
- text: Coûts - text: Coûts
type: PERSON # Était mal labellisé type: PERSON
- text: Notifications - text: Notifications
type: LOCATION # Était mal labellisé type: LOCATION
- text: Article - text: Article
type: LOCATION type: LOCATION
- text: Paragraphe - text: Paragraphe
type: LOCATION type: LOCATION
- text: Directeur - text: Directeur
type: LOCATION # Ou PERSON, selon le contexte où il est mal labellisé seul type: LOCATION
- text: Gérant - text: Gérant
type: LOCATION type: LOCATION
- text: Président - text: Président
type: LOCATION type: LOCATION
- text: DocuSign # Ajouté pour éviter le faux positif comme PERSON - text: DocuSign
type: PERSON type: PERSON
- text: SPRL # Société belge - text: SPRL
type: ORG # Indique que ce n'est pas une personne type: ORG
# Termes financiers courants # Termes financiers courants
- text: Euro - text: Euro
type: LOCATION # Si 'Euro' est mal labellisé type: LOCATION
- text: EUR - text: EUR
type: LOCATION type: LOCATION
- text: Euros - text: Euros
@@ -195,7 +127,7 @@ allow_list:
- text: Arrêté - text: Arrêté
type: LOCATION type: LOCATION
# Mois et dates génériques (si mal labellisés) # Mois et dates génériques
- text: Janvier - text: Janvier
type: LOCATION type: LOCATION
- text: Février - text: Février
@@ -230,12 +162,11 @@ anonymizer_config:
BE_ENTERPRISE_NUMBER: replace BE_ENTERPRISE_NUMBER: replace
FR_SOCIAL_SECURITY_NUMBER: replace FR_SOCIAL_SECURITY_NUMBER: replace
IBAN: replace IBAN: replace
BE_BANK_ACCOUNT: replace # Si vous avez BE_BANK_ACCOUNT comme entité BE_BANK_ACCOUNT: replace
MONEY: replace # Ajoutez cette ligne pour anonymiser la nouvelle entité MONEY MONEY: replace
LOCATION: replace # Ajoutez si vous voulez anonymiser les locations détectées LOCATION: replace
ORG: replace # Ajoutez si vous voulez anonymiser les organisations ORG: replace
# Valeurs de remplacement personnalisées
replacements: replacements:
PERSON: "<PERSON>" PERSON: "<PERSON>"
EMAIL_ADDRESS: "<EMAIL_ADDRESS>" EMAIL_ADDRESS: "<EMAIL_ADDRESS>"
@@ -245,6 +176,6 @@ anonymizer_config:
FR_SOCIAL_SECURITY_NUMBER: "<FR_SOCIAL_SECURITY_NUMBER>" FR_SOCIAL_SECURITY_NUMBER: "<FR_SOCIAL_SECURITY_NUMBER>"
IBAN: "<IBAN>" IBAN: "<IBAN>"
BE_BANK_ACCOUNT: "<COMPTE_BANCAIRE_BE>" BE_BANK_ACCOUNT: "<COMPTE_BANCAIRE_BE>"
MONEY: "<MONEY>" # Remplacement pour les montants monétaires MONEY: "<MONEY>"
LOCATION: "<LOCATION>" # Remplacement pour les locations LOCATION: "<LOCATION>"
ORG: "<ORGANIZATION>" # Remplacement pour les organisations ORG: "<ORGANIZATION>"