Datasets:
Tasks:
Token Classification
Modalities:
Text
Sub-tasks:
named-entity-recognition
Size:
100K - 1M
License:
File size: 4,938 Bytes
60afe5b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | ---
language:
- en
- hi
license: mit
task_categories:
- token-classification
task_ids:
- named-entity-recognition
size_categories:
- 100K<n<1M
tags:
- pii
- indian-pii
- synthetic-data
- maskara
- ml-intern
---
# Maskara Indian PII Dataset (Phase 2)
Synthetic Indian PII dataset for training the Maskara NER model. This version has been expanded and diversified for Phase 2 training.
## Dataset Description
- **Repository:** `somukandula/maskara-indian-pii-200k`
- **Version:** 2.0
- **Language:** English, Hinglish (Hindi-English code-mixed)
- **License:** MIT
- **Task:** Token classification / Named Entity Recognition (NER)
## Splits
| Split | Rows | Purpose |
|:---|---:|:---|
| `train` | ~250,000 | Model training |
| `template_disjoint_eval` | 15,000 | Generalization evaluation: entire template families held out |
| `real_world_eval` | ~2,600 | Manually curated real-world Indian text evaluation |
## Schema
| Column | Type | Description |
|:---|:---|:---|
| `id` | string | Unique example identifier |
| `text` | string | Raw text containing PII |
| `entities` | list[dict] | Character-level spans: `{start, end, label}` |
| `domain` | string | Source domain (e.g. `whatsapp`, `email`, `json`, `ocr`) |
| `locale` | string | Text locale (`en-IN`, `en-US`, `hi-IN`) |
| `difficulty` | string | `easy`, `medium`, `hard`, `hard_negative` |
| `generator` | string | Generator version (`maskara-v2`) |
| `seed` | int | Per-example random seed |
| `template_family` | string | Template family for traceability |
## Supported Entities (17)
`ADDRESS`, `API_KEY`, `CREDIT_CARD`, `DATE_OF_BIRTH`, `DRIVER_LICENSE`, `EMAIL`, `IP_ADDRESS`, `PASSWORD`, `PERSON_NAME`, `PHONE`, `SSN`, `USERNAME`, `AADHAAR`, `PAN_CARD`, `PASSPORT`, `UPI_ID`, `VEHICLE_REG`.
Note: `LOCATION` was removed in Phase 2.
## Diversity Improvements
- **Templates:** 150+ multi-entity templates, 80+ single-entity templates.
- **Formatting variations:** 6–10 per entity (plain, spaced, dashed, labelled, etc.).
- **Hinglish / code-mixed:** ~40% of examples.
- **Hard negatives:** ~15% of examples.
- **Structured / noisy documents:** ~20% of examples.
- **Domains:** WhatsApp, SMS, email, support tickets, HTML, Markdown, JSON, CSV, SQL, logs, OCR, bank statements, government forms, Aadhaar letters, PAN documents, resumes, configuration files.
## Template-Disjoint Evaluation
The following template families are excluded from training and reserved for the `template_disjoint_eval` split:
- `passport_application`
- `transport_challan`
- `json_payload`
- `config_yaml`
- `html_user`
- `api_request_json`
- `sms_link`
- `finance_pipe`
- `identity_kyc`
- `medical_record`
## Real-World Evaluation
A manually curated split containing realistic Indian text such as:
- Customer support conversations
- Hinglish chats
- OCR-noisy documents
- Government forms
- JSON payloads
- API request bodies
- Log lines
- Bank statements
- Emails
- Transport challans
This split is never used during training.
## Usage
```python
from datasets import load_dataset
dataset = load_dataset("somukandula/maskara-indian-pii-200k")
print(dataset["train"][0])
```
## Generation
Generated using `maskara_dataset_generator.py` (Maskara Phase 2 generator). Each example is produced by filling placeholder-based templates with synthetic values and recording character-level entity spans.
## Phase 2 Error-Analysis Augmentation
After the first Phase 2 training run, targeted synthetic examples were added for entities that underperformed on real-world and template-disjoint evaluation:
- `CREDIT_CARD`
- `PASSWORD`
- `DRIVER_LICENSE`
- `USERNAME`
- `ADDRESS`
- `IP_ADDRESS`
- `PHONE`
- `AADHAAR`
- `PAN_CARD`
These examples live in `phase2/targeted_augmentation.py` and are merged into the train split before retraining.
## Files in this repository
| File | Description |
|---|---|
| `maskara_dataset_generator.py` | Full synthetic dataset generator |
| `generate_maskara_phase2_dataset.py` | Script that generates and pushes all splits |
| `phase2/targeted_augmentation.py` | Targeted augmentation for weak entities |
| `phase2/train_maskara.py` | Training pipeline |
| `phase2/evaluate_maskara.py` | Evaluation pipeline |
| `phase2/error_analysis_loop.py` | Error analysis and actionable report generator |
| `phase2/retrain_with_augmentation.py` | End-to-end retraining with augmentation |
## Citation
```bibtex
@misc{maskara_dataset2026,
title={Maskara Indian PII Dataset},
author={Somu Kandula},
year={2026},
howpublished={\url{https://huggingface.co/datasets/somukandula/maskara-indian-pii-200k}}
}
```
<!-- ml-intern-provenance -->
## Generated by ML Intern
This dataset repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub.
- Try ML Intern: https://smolagents-ml-intern.hf.space
- Source code: https://github.com/huggingface/ml-intern
|