CoolFace
Modelpublic

OpenMed/OpenMed-PII-French-SnowflakeMed-Large-568M-v1

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
3likes12kdownloads
Model Card

OpenMed-PII-French-SnowflakeMed-Large-568M-v1

French PII Detection Model | 568M Parameters | Open Source

![F1 Score]() ![Precision]() ![Recall]()

Model Description

OpenMed-PII-French-SnowflakeMed-Large-568M-v1 is a transformer-based token classification model fine-tuned for Personally Identifiable Information (PII) detection in French text. This model identifies and classifies 54 types of sensitive information including names, addresses, social security numbers, medical record numbers, and more.

Key Features

  • French-Optimized: Specifically trained on French text for optimal performance
  • High Accuracy: Achieves strong F1 scores across diverse PII categories
  • Comprehensive Coverage: Detects 55+ entity types spanning personal, financial, medical, and contact information
  • Privacy-Focused: Designed for de-identification and compliance with GDPR and other privacy regulations
  • Production-Ready: Optimized for real-world text processing pipelines

Performance

Evaluated on the French subset of AI4Privacy dataset:

MetricScore
Micro F10.9728
Precision0.9711
Recall0.9745
Macro F10.9661
Weighted F10.9724
Accuracy0.9962

Top 10 French PII Models

RankModelF1PrecisionRecall
1OpenMed-PII-French-SuperClinical-Large-434M-v10.97970.97900.9804
2OpenMed-PII-French-EuroMed-210M-v10.97620.97470.9777
3OpenMed-PII-French-ClinicalBGE-568M-v10.97330.97180.9748
4OpenMed-PII-French-BigMed-Large-560M-v10.97330.97160.9749
5[OpenMed-PII-French-SnowflakeMed-Large-568M-v1](https://huggingface.co/OpenMed/OpenMed-PII-French-SnowflakeMed-Large-568M-v1)0.97280.97110.9745
6OpenMed-PII-French-SuperMedical-Large-355M-v10.97280.97120.9744
7OpenMed-PII-French-NomicMed-Large-395M-v10.97220.97040.9740
8OpenMed-PII-French-mClinicalE5-Large-560M-v10.97130.96970.9729
9OpenMed-PII-French-mSuperClinical-Base-279M-v10.96740.96620.9687
10OpenMed-PII-French-ClinicalBGE-Large-335M-v10.96680.96440.9692

Supported Entity Types

This model detects 54 PII entity types organized into categories:

<details> <summary><strong>Identifiers</strong> (22 types)</summary>

EntityDescription
ACCOUNTNAMEAccountname
BANKACCOUNTBankaccount
BICBic
BITCOINADDRESSBitcoinaddress
CREDITCARDCreditcard
CREDITCARDISSUERCreditcardissuer
CVVCvv
ETHEREUMADDRESSEthereumaddress
IBANIban
IMEIImei
...and 12 more

</details>

<details> <summary><strong>Personal Info</strong> (11 types)</summary>

EntityDescription
AGEAge
DATEOFBIRTHDateofbirth
EYECOLOREyecolor
FIRSTNAMEFirstname
GENDERGender
HEIGHTHeight
LASTNAMELastname
MIDDLENAMEMiddlename
OCCUPATIONOccupation
PREFIXPrefix
...and 1 more

</details>

<details> <summary><strong>Contact Info</strong> (2 types)</summary>

EntityDescription
EMAILEmail
PHONEPhone

</details>

<details> <summary><strong>Location</strong> (9 types)</summary>

EntityDescription
BUILDINGNUMBERBuildingnumber
CITYCity
COUNTYCounty
GPSCOORDINATESGpscoordinates
ORDINALDIRECTIONOrdinaldirection
SECONDARYADDRESSSecondaryaddress
STATEState
STREETStreet
ZIPCODEZipcode

</details>

<details> <summary><strong>Organization</strong> (3 types)</summary>

EntityDescription
JOBDEPARTMENTJobdepartment
JOBTITLEJobtitle
ORGANIZATIONOrganization

</details>

<details> <summary><strong>Financial</strong> (5 types)</summary>

EntityDescription
AMOUNTAmount
CURRENCYCurrency
CURRENCYCODECurrencycode
CURRENCYNAMECurrencyname
CURRENCYSYMBOLCurrencysymbol

</details>

<details> <summary><strong>Temporal</strong> (2 types)</summary>

EntityDescription
DATEDate
TIMETime

</details>

Usage

Quick Start

python
from transformers import pipeline

# Load the PII detection pipeline
ner = pipeline("ner", model="OpenMed/OpenMed-PII-French-SnowflakeMed-Large-568M-v1", aggregation_strategy="simple")

text = """
Patient Jean Martin (né le 15/03/1985, NSS: 1 85 03 75 108 234 67) a été vu aujourd'hui.
Contact: jean.martin@email.fr, Téléphone: 06 12 34 56 78.
Adresse: 123 Avenue des Champs-Élysées, 75008 Paris.
"""

entities = ner(text)
for entity in entities:
    print(f"{entity['entity_group']}: {entity['word']} (score: {entity['score']:.3f})")

De-identification Example

python
def redact_pii(text, entities, placeholder='[REDACTED]'):
    """Replace detected PII with placeholders."""
    # Sort entities by start position (descending) to preserve offsets
    sorted_entities = sorted(entities, key=lambda x: x['start'], reverse=True)
    redacted = text
    for ent in sorted_entities:
        redacted = redacted[:ent['start']] + f"[{ent['entity_group']}]" + redacted[ent['end']:]
    return redacted

# Apply de-identification
redacted_text = redact_pii(text, entities)
print(redacted_text)

Batch Processing

python
from transformers import AutoModelForTokenClassification, AutoTokenizer
import torch

model_name = "OpenMed/OpenMed-PII-French-SnowflakeMed-Large-568M-v1"
model = AutoModelForTokenClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

texts = [
    "Patient Jean Martin (né le 15/03/1985, NSS: 1 85 03 75 108 234 67) a été vu aujourd'hui.",
    "Contact: jean.martin@email.fr, Téléphone: 06 12 34 56 78.",
]

inputs = tokenizer(texts, return_tensors='pt', padding=True, truncation=True)
with torch.no_grad():
    outputs = model(**inputs)
    predictions = torch.argmax(outputs.logits, dim=-1)

Training Details

Dataset

  • Source: AI4Privacy PII Masking 400k (French subset)
  • Format: BIO-tagged token classification
  • Labels: 109 total (54 entity types × 2 BIO tags + O)

Training Configuration

  • Max Sequence Length: 512 tokens
  • Epochs: 3
  • Framework: Hugging Face Transformers + Trainer API

Intended Use & Limitations

Intended Use

  • De-identification: Automated redaction of PII in French clinical notes, medical records, and documents
  • Compliance: Supporting GDPR, and other privacy regulation compliance
  • Data Preprocessing: Preparing datasets for research by removing sensitive information
  • Audit Support: Identifying PII in document collections

Limitations

Important: This model is intended as an assistive tool, not a replacement for human review.

  • False Negatives: Some PII may not be detected; always verify critical applications
  • Context Sensitivity: Performance may vary with domain-specific terminology
  • Language: Optimized for French text; may not perform well on other languages

Citation

bibtex
@misc{openmed-pii-2026,
  title = {OpenMed-PII-French-SnowflakeMed-Large-568M-v1: French PII Detection Model},
  author = {OpenMed Science},
  year = {2026},
  publisher = {Hugging Face},
  url = {https://huggingface.co/OpenMed/OpenMed-PII-French-SnowflakeMed-Large-568M-v1}
}

Links