Downloads · 30 days
11
12% of all-time downloads
satyamg1620/bert-pii-detector-finance-merged
bert-pii-detector-finance-merged is a token classification model from satyamg1620. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
This is a domain-specific Personally Identifiable Information (PII) detection model fine-tuned for finance applications. The model identifies and classifies sensitive information in finance text using token-level clas…
Downloads · 30 days
11
12% of all-time downloads
All-time downloads
91
Public
Parameters
109M
436 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors436 MB · 100%
From the Hugging Face model README
This is a domain-specific Personally Identifiable Information (PII) detection model fine-tuned for finance applications. The model identifies and classifies sensitive information in finance text using token-level classification.
Base Model: bert-base-uncased (109M parameters)
Training Method: LoRA (Low-Rank Adaptation)
Task: Token Classification (Named Entity Recognition)
Entity Types: 29 types
| Metric | Score |
|---|---|
| Accuracy | 80.00% |
| F1 Score | 62.04% |
Training Dataset: NVIDIA Nemotron-PII (finance domain)
Training Samples: 15000
Training Epochs: 3
LoRA Rank: 8
Trainable Parameters: ~521K (0.48% of base model)
Total: 59 BIO labels across 29 entity types
pip install transformers torch
from transformers import AutoModelForTokenClassification, AutoTokenizer
import torch
# Load model and tokenizer
model_name = "your-org/mom-pii-finance"
model = AutoModelForTokenClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Prepare input
text = "Patient John Smith, DOB: 03/15/1985, SSN: 123-45-6789"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
# Get predictions
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=-1)[0]
# Extract entities
entities = []
current_entity = None
for token, pred_id in zip(tokens, predictions):
if token in ['[CLS]', '[SEP]', '[PAD]']:
continue
label = model.config.id2label[pred_id.item()]
if label.startswith('B-'):
if current_entity:
entities.append(current_entity)
entity_type = label[2:]
current_entity = {'type': entity_type, 'tokens': [token]}
elif label.startswith('I-') and current_entity:
current_entity['tokens'].append(token)
else:
if current_entity:
entities.append(current_entity)
current_entity = None
if current_entity:
entities.append(current_entity)
# Clean up tokens
for entity in entities:
entity['text'] = tokenizer.convert_tokens_to_string(entity['tokens'])
print(f"{entity['type']}: {entity['text']}")
from transformers import pipeline
ner = pipeline(
"token-classification",
model="your-org/mom-pii-finance",
aggregation_strategy="simple",
device=0 # Use GPU
)
results = ner("Patient John Smith, DOB: 03/15/1985, SSN: 123-45-6789")
for entity in results:
print(f"{entity['entity_group']}: {entity['word']} ({entity['score']:.2f})")
For structured PII (medical records, credit cards, phone numbers), consider:
@misc{mom-pii-finance-2026,
title={Healthcare PII Detection Model},
author={Your Organization},
year={2026},
publisher={HuggingFace},
howpublished={\url{https://huggingface.co/your-org/mom-pii-finance}},
}
Apache 2.0