Views
No views yet
| Property | Value |
|---|---|
| Base Model | llm-semantic-router/mmbert-32k-yarn |
| Architecture | ModernBERT (Flash Attention 2) |
| Parameters | 307M |
| Task | Token Classification (NER) |
| Max Context | 32,768 tokens |
| Entity Types | 17 PII types (35 BIO labels) |
PERSON - Person names (98.7% accuracy)EMAIL_ADDRESS - Email addresses (95%+ accuracy)PHONE_NUMBER - Phone numbers (99.1% accuracy)STREET_ADDRESS - Street addresses (95.9% accuracy)CREDIT_CARD - Credit card numbers (84% accuracy)US_SSN - US Social Security NumbersUS_DRIVER_LICENSE - US Driver License numbersIBAN_CODE - International Bank Account NumbersIP_ADDRESS - IP addressesDATE_TIME - Dates and timesAGE - Age informationORGANIZATION - Organization namesGPE - Geopolitical entitiesZIP_CODE - ZIP/postal codesDOMAIN_NAME - Domain namesNRP - Nationalities, religious or political groupsTITLE - Titles (Mr., Dr., etc.)1from transformers import AutoModelForTokenClassification, AutoTokenizer
2import torch
3
4model = AutoModelForTokenClassification.from_pretrained(
5 "llm-semantic-router/mmbert32k-pii-detector-merged"
6)
7tokenizer = AutoTokenizer.from_pretrained(
8 "llm-semantic-router/mmbert32k-pii-detector-merged"
9)
10
11text = "My email is john.smith@example.com and phone is 555-123-4567"
12inputs = tokenizer(text, return_tensors="pt", truncation=True)
13
14with torch.no_grad():
15 outputs = model(**inputs)
16 predictions = torch.argmax(outputs.logits, dim=2)
17
18# Get label mapping
19id2label = model.config.id2label
20for token, pred in zip(tokenizer.convert_ids_to_tokens(inputs["input_ids"][0]), predictions[0]):
21 label = id2label[str(pred.item())]
22 if label != "O":
23 print(f"{token}: {label}")