Sometimes synthetic data is not enough. A team building a document-extraction model needs the real layouts, the real tables, the real mess of a broker's submission pack. What it must not have is the real names, addresses and numbers in them. Masking each document separately fails in a subtle way: "Copperline Freight" becomes "Company A" in one file and "Company B" in the next, and the relationships the model should learn are gone. InsightDataGen's de-identification workflow replaces every entity once, for the whole batch, and puts a person in the loop before anything is rewritten.
The workflow
1. Create a project and upload
A project holds a batch of source documents: PDF, Word (DOCX) and Excel (XLSX, XLS). Working files stay in a per-project directory.
2. Detect, resolve, synthesize
A background job extracts the text, then asks a model to list every sensitive entity with the documents it occurs in. A resolver then clusters the surface variants of the same entity (full name and email, first and last name, "Last, First", reversed and partial forms) into one canonical entity, and a synthesizer proposes one synthetic value for it and for each of its variants. The result is stored as an editable mapping, and the project moves to review. Progress is streamed to the client while it runs.
The detector's prompts are tuned for insurance submissions, with entity types such as insured organisation, insured person, broker firm, broker person. Other domains add their own entity types and prompts.
3. Review
Nothing has been rewritten yet. A reviewer reads the proposed original-to-synthetic map and can override the canonical synthetic value for an entity, or one exact replacement string, where the proposal is wrong or awkward.
4. Regenerate
A second background job builds one replacement table from the reviewed mapping and applies it to every source document. The project moves to completed; each rewritten document can be listed and downloaded, and per-document records say what was replaced.
The project's states
| State | What is happening | What you can do |
|---|---|---|
| PENDING | Documents uploaded, nothing run yet | Start detection |
| DETECTING | Extraction, detection, resolution and synthesis | Watch progress |
| REVIEW | The mapping is ready; no document has been touched | Read and override the mapping, then regenerate |
| REPLACING | The reviewed table is being applied to every document | Watch progress |
| COMPLETED or PARTIAL | All documents rewritten, or some failed | Download; for PARTIAL, check each document's state first |
A hard error marks the project FAILED. PARTIAL is the one to be careful with: a batch released to another team should not contain a document that failed to rewrite.
How replacements are made
The synthetic values
Each canonical entity gets one synthetic identity per project. People get a generated name, and each variant ("Last, First", first name only) is re-rendered in the same shape; organisations get a generated company name, with a short alias for short forms; emails are rebuilt from the synthetic person and company. Identifiers, FEINs and phone numbers keep their shape: digits stay digits, letters stay letters and separators stay where they were, so a policy number still looks like a policy number. Values are derived from a random salt created with the project, so the same original always maps to the same replacement within a project, and to a different one in another project.
Per file type
- Word: text is replaced run by run, so formatting survives. When an entity is split across runs (a bold first name and a plain surname), the paragraph's text is collapsed into its first run, which keeps that run's formatting only. Tables, headers and footers are covered; images are untouched.
- Excel: only text cell values are rewritten; styles, number formats and merged cells stay. Formula cells are skipped, so a name inside a formula stays as it was.
- PDF: each occurrence is covered with a redaction and the synthetic value is drawn into the same box, with the font shrunk to fit. This works on the text layer; scanned pages are read with OCR (AWS Textract) for detection, and image-only pages are best checked by a reviewer page by page.
Longer originals are replaced before shorter ones, so "Copperline Freight Ltd." is handled before "Copperline". Every replacement is recorded with where it happened (a page, a sheet and cell), which is what makes a review of the output practical.
Why one table for the batch
Detection, resolution and synthesis run once for the whole batch, and the single replacement table is applied to every document. That is what keeps "the same broker" the same broker across fifty files, which is precisely the information a downstream model or analyst needs.
Questions privacy teams ask
Can two batches share one mapping?
Not across projects: each project has its own salt, so the same name gets a different replacement in the next project. If documents
must stay consistent with each other, put them in one project. Legacy .xls files are accepted; for the
cleanest result, convert them to .xlsx first and check the output.
What does the model see?
The extracted text of each document, sent to the Bedrock model in your account; the default is a Claude Sonnet model, configurable by environment variable.
When to use it, and when not
- Use it when the documents' structure matters (layouts, tables, cross-references) and the values do not.
- Use synthetic generation instead when you can describe the documents with a template and a schema: nothing real ever enters the process.
- Do neither for documents you are not permitted to process for this purpose in the first place.


