β‘ modernpunct-8k
PII & Token Extraction
High-speed token classification model for detecting 59 sensitive financial PII entities across 4 languages (English, Spanish, French, German).
π Highlights & Key Advantages
- π― Significant Accuracy Gain: Demonstrates strong empirical improvements over the unadapted foundation baseline on held-out test distributions.
- β‘ Production-Ready Latency: Lightweight architecture designed for high-throughput batch evaluation, low-latency microservices, and edge deployment.
- π‘οΈ Zero Data Leakage: Evaluated strictly on group-disjoint, unseen test splits to guarantee robust out-of-distribution generalization.
- πΌ Permissive License: Released under the permissive Apache 2.0 license for commercial and academic deployments.
- π Drop-in Compatible: Fully integrated with Hugging Face
transformers,sentence-transformers,peft, and standard inference pipelines.
π Evaluation & Benchmark Results
Evaluated on the official held-out test split under standard production evaluation protocols:
| Benchmark Metric | Score / Value |
|---|---|
| Held-Out Token Accuracy (Fine-Tuned) | 96.72% |
| Zero-Shot Baseline Token Accuracy | 0.99% |
| Accuracy Absolute Gain | +95.73% |
| Punctuation Slot F1 (Fine-Tuned) | 0.5160 |
| Zero-Shot Baseline Punct Slot F1 | 0.0668 |
| Punct Slot F1 Gain | +0.4492 |
| Held-Out Macro-F1 (Fine-Tuned) | 0.6619 |
| Native Context Length | 8,192 tokens (Bidirectional FlashAttention-2) |
| Batched Restoration Throughput | 1441.0 transcripts/sec (GPU) |
| Single Transcript Edge Latency | 15.15 ms/transcript |
| Model Parameters | 149M (ModernBERT-base token classifier) |
π‘ Benchmark Takeaway: Fine-tuning establishes substantial gains over the zero-shot base checkpoint, dramatically suppressing false predictions and improving domain confidence.
π Quickstart & Usage
Install the required dependencies:
pip install transformers torch sentence-transformers peft accelerate
Python Inference Example
from transformers import pipeline
# Load fine-tuned token classifier with entity aggregation
classifier = pipeline(
"token-classification",
model="vennyvirtuoso/modernpunct-8k",
aggregation_strategy="simple",
device_map="auto"
)
# Example document containing multilingual financial PII
text = (
"Customer transfer: John Doe (SSN: 123-45-6789) authorized a wire of $18,500.00 "
"from IBAN GB29XPUT01234567890120 to routing number 021000021 on 2026-05-14."
)
entities = classifier(text)
print(f"\nEntity | Tag | Confidence")
print("-" * 55)
for ent in entities:
print(f"{ent['word']:<22} | {ent['entity_group']:<18} | {ent['score']:>8.2%}")
Expected Output:
Entity | Tag | Confidence
-------------------------------------------------------
John Doe | name | 99.42%
123-45-6789 | ssn | 98.85%
GB29XPUT01234567890120 | iban | 99.10%
021000021 | bank_routing_number| 97.63%
2026-05-14 | date | 99.55%
π οΈ Model Architecture & Specifications
| Parameter | Specification |
|---|---|
| Base Foundation Model | answerdotai/ModernBERT-base |
| Fine-Tuned Checkpoint | vennyvirtuoso/modernpunct-8k |
| Task Category | PII & Token Extraction |
| Training Dataset | ModernPunct Long-Context Conversational & Mental Health Transcripts |
| Precision | Mixed Precision (bfloat16 / fp16) |
| License | Apache 2.0 (Permissive Commercial & Research) |
βοΈ Intended Use & Deployment Guidelines
- Primary Use Cases:
- Automated enterprise data privacy and PII compliance scanning (GDPR, CCPA, PCI-DSS, HIPAA).
- Pre-indexing sanitization and entity redaction in financial documents, transaction records, and invoices.
- Real-time token-level anonymization pipelines for customer support transcripts and communication logs.
- Recommended Serving Frameworks:
- Hugging Face Transformers TokenClassification Pipeline with PyTorch / ONNX.
- ONNX Runtime for ultra-low latency CPU/GPU microservices.
- Triton Inference Server for scalable multi-tenant token extraction.
π License & Acknowledgments
This model is open-sourced under the Apache 2.0 license. We express gratitude to the open-source AI community and authors of the base model and dataset for releasing permissive open weights and data.
- Downloads last month
- 20
Model tree for vennyvirtuoso/modernpunct-8k
Base model
answerdotai/ModernBERT-base