Instructions to use somukandula/maskara with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use somukandula/maskara with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="somukandula/maskara")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("somukandula/maskara") model = AutoModelForTokenClassification.from_pretrained("somukandula/maskara", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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_CARDandPASSWORDshow 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
Model tree for somukandula/maskara
Base model
google-bert/bert-base-uncased