Downloads · 30 days
33
26% of all-time downloads
vllm-sr/mmbert-pii-detector-lora
mmbert-pii-detector-lora is a token classification model from vllm-sr. Use it when you need labels on individual words, such as names. It is set up for peft. The card lists the license as apache-2.0.
A multilingual token classification model for Personal Identifiable Information (PII) detection using mmBERT with LoRA adapters.
Downloads · 30 days
33
26% of all-time downloads
All-time downloads
128
Public
Repo size
61.5 MB
Likes
0
Public
Click a slice to open those files.
.json34.4 MB · 56%
From the Hugging Face model README
A multilingual token classification model for Personal Identifiable Information (PII) detection using mmBERT with LoRA adapters.
This model detects and classifies PII entities at the token level using BIO tagging:
| Metric | Score |
|---|---|
| Accuracy | 92.0% |
| F1 (weighted) | 91.0% |
| Training Time | 43 seconds (MI300X GPU) |
from peft import PeftModel
from transformers import AutoModelForTokenClassification, AutoTokenizer
# Load model
base_model = AutoModelForTokenClassification.from_pretrained(
"jhu-clsp/mmBERT-base", num_labels=35 # O + 17 entity types × 2 (B/I)
)
model = PeftModel.from_pretrained(base_model, "vllm-sr/mmbert-pii-detector-lora")
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/mmBERT-base")
# Detect PII
text = "Contact John Smith at [email protected] or call 555-123-4567"
inputs = tokenizer(text.split(), is_split_into_words=True, return_tensors="pt")
outputs = model(**inputs)
predictions = outputs.logits.argmax(-1)
# Map predictions to labels
# ... (see full example in repository)
| Entity Type | Description |
|---|---|
| PERSON | Full names |
| EMAIL_ADDRESS | Email addresses |
| PHONE_NUMBER | Phone numbers (various formats) |
| STREET_ADDRESS | Physical addresses |
| CREDIT_CARD | Credit card numbers |
| US_SSN | US Social Security Numbers |
| IP_ADDRESS | IP addresses |
| DATE_TIME | Dates and times |
| URL | Web URLs |
| ORGANIZATION | Company/org names |
This model is part of the vLLM Semantic Router project.
Apache 2.0