⚑ modernpunct-8k

PII & Token Extraction

License: Apache-2.0 Base Model Task Benchmark

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:

πŸ“œ 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
Safetensors
Model size
0.1B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for vennyvirtuoso/modernpunct-8k

Finetuned
(1,621)
this model