IndicPHI is a reproducible synthetic clinical data pipeline for Indic-language PHI/PII de-identification. It generates multilingual synthetic clinical documents across 23 languages (22 official Indian languages plus English), annotates inline PHI/PII surrogates, audits them with an LLM judge plus deterministic validators, curates them with NeMo Curator, and exports GLiNER-ready span labels with a persona-held-out train/eval split.
If you are searching for Indic synthetic dataset, Indian clinical NER, multilingual PHI de-identification, synthetic health records for Indian languages, Aadhaar-safe clinical data, or GLiNER training data for Indic languages, this repository is built for that problem.
Real Indian clinical text cannot be freely shared (DPDP). We synthesize
realistic clinical docs across Indic languages, seeded by
nvidia/Nemotron-Personas-India, with checksum-valid surrogates and a
fail-closed audit loop.
- Synthetic Indian clinical documents across 23 languages
- Inline PHI/PII surrogate tags such as
[[TYPE|value]] - Deterministic validation for identifiers like Aadhaar and phone numbers
- NeMo Curator-based deduplication and balancing
- GLiNER-ready training and evaluation exports
- Timestamped run folders with
manifest.json,pipeline.resolved.yaml, andfailures.md
End-to-end flow from Nemotron personas through generation, audit/repair, and curation to a GLiNER train/eval set. Green-bordered stages use NVIDIA tooling; orange loops mark in-stage repair.
| Stage | Role | Module |
|---|---|---|
| S1 | Seeded hash-rank persona sampling + demographics audit | main/designers/persona_sampler.py |
| S2 | Taxonomy 14 doc types x 7 domains | main/designers/taxonomy.py |
| S2b | Persona clinical summary (Sarvam-30B, row-checkpointed) | main/designers/persona_summarizer.py |
| S3 | Prompt construction + entity profiles | main/designers/prompt_builder.py |
| S4 | NeMo Data Designer generation (Sarvam-105B) + tag/stuffing repair | main/pipeline/designer_config.py |
| S4b | Tag-preserving translation + script repair | main/designers/translator.py |
| S5 | Linguistic judge (Grok-4.3 / Azure Foundry, checkpointed) | main/designers/linguistic_judge.py |
| S6 | Deterministic auditor (checksums, PHI residue, DICS) | main/designers/deterministic_auditor.py |
| S7-S8 | NeMo Curator fuzzy dedup + semantic pass + balance | main/pipeline/curate.py |
| S9 | GLiNER format + intrinsic metrics | main/pipeline/gliner_format.py |
| S10 | Persona-held-out train/eval split | main/pipeline/split.py |
Agent entrypoints are summarized under main/agents/.
Each persona is assigned a cell in a 14 document types × 7 clinical domains grid. Eligibility gates block impossible combinations (for example, maternal delivery notes for male personas).
Roles were assigned from a multi-task benchmark (accuracy and invalid-output rate). Grok-4.3 is the linguistic judge (0% invalid outputs). Sarvam-105B is the generator/translator. Sarvam-30B is limited to persona summarization because of higher invalid-output rates on structural tasks.
- Python
>=3.12 uv- API credentials for:
SARVAM_API_KEYAZURE_FOUNDRY_API_KEY
- Access to the required NVIDIA tooling used by the configs in this repo:
- NeMo Data Designer
- NeMo Curator
nvidia/Nemotron-Personas-India
# 1) Create env file with required keys
cp configs/nim.env.example .env
# 2) Install dependencies
uv sync
# 3) Run a small smoke pipeline
./scripts/smoke_test.sh
# 4) Print the latest run/report locations
./scripts/run_demo.sh --no-runPopulate .env with at least SARVAM_API_KEY and AZURE_FOUNDRY_API_KEY
before running generation.
New runs write to data/generated/runs/<timestamp>/. Each run records:
pipeline.resolved.yamlfor the exact resolved configmanifest.jsonfor run metadatafailures.mdfor rejected or repaired records
# Default smoke run: about 10 docs across 10 languages
./scripts/smoke_test.sh
# Medium smoke run: about 20 docs
./scripts/smoke_test.sh configs/synthetic-data/pipeline.smoke.medium.yaml
# Diversity run: 23 languages, about 69 docs
python -m main.pipeline.run_pipeline \
--config configs/synthetic-data/pipeline.diversity.yamlFastAPI backend for the IndicPHI presentation UI (main/ui_api/):
# Terminal 1 - API on http://127.0.0.1:8765
./scripts/run_ui.sh
# Terminal 2 - Vite UI (when ui/ is present)
cd ui && npm install && npm run dev- Replay:
POST /api/replay/{run_id}builds a ~40s event timeline from an existing folder underdata/generated/runs/. No API keys required. - Live smoke:
POST /api/runswith{num_docs, language_codes}writes a temporary YAML overlay onpipeline.smoke.yamland runs the orchestrator in a background thread. Progress is available viaGET /api/runs/{id}or/api/runs/{id}/stream. This requires.env.
Configs: configs/synthetic-data/pipeline.yaml (full),
pipeline.smoke.yaml (10 docs), pipeline.smoke.medium.yaml (20 docs),
pipeline.diversity.yaml (23 languages, about 69 docs).
Persona seed shard: data/nemotron-personas-india/
(nvidia/Nemotron-Personas-India local parquet).
- NeMo Data Designer (S4): required engine (
generation.engine: data_designer). No silent Sarvam-HTTP bypass around Designer. Post-gen repair for missing tags / stuffing via generator (main/designers/repair.py). - NeMo Curator (S7): required backend (
curation.dedup.backend: nemo_curator).cpu_minhashis disabled. Semantic near-dup runs after Curator on English-pivot / PHI-masked text. - Personas:
nvidia/Nemotron-Personas-India. - Sarvam-105B: generation + translation across 22 official Indian languages plus English
.
README.md LICENSE .gitignore
docs/ architecture, demo-script, evaluation-plan, blog, planning
main/ agents/ + designers + pipeline + entities + llm + validators
configs/ nim.env.example + training + synthetic-data
data/
samples/ stage previews
eval/ gold/eval placeholders
nemotron-personas-india/ persona seed shard for S1
scripts/ smoke_test.sh + run_demo.sh + helpers
results/
runs/ packaged run folders (s1-s10 artifacts)
logs/ smoke console logs
audits/ failures_*.md quick views
eval_report.md
screenshots/
No notebooks/ directory is used.
- The orchestrator is config-driven; the exact config used for a run is saved in each run directory.
- Stage outputs are checkpointed so interrupted runs can be resumed.
- Validation is fail-closed: invalid checksum, residue, or structural issues are not silently accepted.
- The smoke config is the easiest way to verify your setup before attempting the 23-language diversity run.
- If
./scripts/smoke_test.shcannot find a virtualenv, it falls back topython3. - If
.envis missing,./scripts/run_demo.shwarns and only works if keys are already exported in your shell. - If a run fails mid-pipeline, inspect
data/generated/runs/latest/andfailures.mdfirst. - Use
results/README.mdandresults/eval_report.mdfor packaged evidence and expected output examples.
docs/architecture.mddocs/idea.mddocs/plan.mddocs/demo-script.mddocs/evaluation-plan.mddocs/diversification-120k.mddocs/blog.mdresults/eval_report.mdresults/README.md
MIT - see LICENSE.



