maskara

A BERT-based token classification model for detecting personally identifiable information (PII) in text. It is trained with BIO tagging and covers 17 PII types including Aadhaar, PAN, passport, credit card, phone, email, API keys, and passwords.

Model Versions

Version Description Location
v1 First full training on ~500k synthetic OpenPII-style samples. full-openpii-500k/final/
v2 Phase-two retrained model with augmented + real-world data. repo root (model.safetensors)

Accuracy Comparison

Split Metric v1 v2 (current) Improvement
Template-disjoint F1 0.8930 0.8417 -0.0513
Template-disjoint Accuracy 0.9725 0.9437 -0.0288
Real-world F1 0.8937 0.8868 -0.0069
Real-world Accuracy 0.9504 0.9423 -0.0081

v2 was tuned for stronger real-world recall rather than overall accuracy; see phase2_metrics.json and retrain_metrics.json for per-label details.

Model Details

Attribute Value
Architecture BertForTokenClassification
Base architecture BERT-base-uncased
Hidden size 768
Layers / Heads 12 / 12
Max position embeddings 512
Parameters 108,918,563
Vocab size 30,522
Labels 35 BIO labels + O

Usage

from transformers import pipeline

ner = pipeline(
    "ner",
    model="somukandula/maskara",
    aggregation_strategy="simple"
)

ner("My email is john.doe@example.com and phone is +91-98765-43210.")

Limitations

  • Trained primarily on English and Indian PII patterns; performance may vary on other locales or languages.
  • CREDIT_CARD and PASSWORD show low or zero real-world F1; consider post-processing rules for production.
  • Max sequence length is 512 tokens; chunk longer inputs.
Downloads last month
14
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for somukandula/maskara

Finetuned
(6851)
this model