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, "llm-semantic-router/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)
Supported PII Types
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
Use Cases
Privacy Compliance
: GDPR, CCPA compliance
Data Masking
: Redact PII before processing
LLM Safety
: Prevent PII leakage in LLM outputs
Document Processing
: Automated PII detection in documents
mmbert-pii-detector-lora huggingface.co is an AI model on huggingface.co that provides mmbert-pii-detector-lora's model effect (), which can be used instantly with this llm-semantic-router mmbert-pii-detector-lora model. huggingface.co supports a free trial of the mmbert-pii-detector-lora model, and also provides paid use of the mmbert-pii-detector-lora. Support call mmbert-pii-detector-lora model through api, including Node.js, Python, http.
mmbert-pii-detector-lora huggingface.co is an online trial and call api platform, which integrates mmbert-pii-detector-lora's modeling effects, including api services, and provides a free online trial of mmbert-pii-detector-lora, you can try mmbert-pii-detector-lora online for free by clicking the link below.
llm-semantic-router mmbert-pii-detector-lora online free url in huggingface.co:
mmbert-pii-detector-lora is an open source model from GitHub that offers a free installation service, and any user can find mmbert-pii-detector-lora on GitHub to install. At the same time, huggingface.co provides the effect of mmbert-pii-detector-lora install, users can directly use mmbert-pii-detector-lora installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
mmbert-pii-detector-lora install url in huggingface.co: