# mmBERT-32K PII Detector (LoRA) Token classification model for detecting Personally Identifiable Information (PII) based on **mmBERT-32K-YaRN**. ## Model Description This model performs Named Entity Recognition (NER) to identify and classify PII entities in text. ### Supported PII Types (17 categories) - **PERSON**: Names of individuals - **ORGANIZATION**: Company/organization names - **STREET_ADDRESS**: Physical addresses - **GPE**: Geopolitical entities (cities, countries) - **EMAIL_ADDRESS**: Email addresses - **PHONE_NUMBER**: Phone numbers - **DATE_TIME**: Dates and times - **CREDIT_CARD**: Credit card numbers - **US_SSN**: US Social Security Numbers - **IP_ADDRESS**: IP addresses - **DOMAIN_NAME**: Domain names - **IBAN_CODE**: International Bank Account Numbers - **US_DRIVER_LICENSE**: US driver's license numbers - **ZIP_CODE**: ZIP/postal codes - **AGE**: Age information - **NRP**: Nationality, religion, political group - **TITLE**: Titles and honorifics ### Base Model - **Base**: [llm-semantic-router/mmbert-32k-yarn](https://huggingface.co/llm-semantic-router/mmbert-32k-yarn) - **Architecture**: ModernBERT with YaRN RoPE scaling - **Context Length**: 32,768 tokens - **Task**: Token Classification (BIO tagging) ### Training Details - **Method**: LoRA fine-tuning - **LoRA Rank**: 8 - **Dataset**: Presidio synthetic PII dataset - **Labels**: 35 (17 entity types × 2 BIO tags + O) ## Usage ```python from transformers import AutoTokenizer, AutoModelForTokenClassification from peft import PeftModel base_model = "llm-semantic-router/mmbert-32k-yarn" adapter = "llm-semantic-router/mmbert32k-pii-detector-lora" tokenizer = AutoTokenizer.from_pretrained(adapter) model = AutoModelForTokenClassification.from_pretrained(base_model, num_labels=35) model = PeftModel.from_pretrained(model, adapter) text = "Contact John Smith at john@example.com or 555-1234" inputs = tokenizer(text, return_tensors="pt") outputs = model(**inputs) ``` ## Intended Use - PII detection and redaction - Data privacy compliance - Sensitive information filtering - GDPR/CCPA compliance tools ## License Apache 2.0