De-identify Text
Send text to Guardian Layer, get a safer version back. Use fictional data to try it.
- Python
- TypeScript
from custodian_labs import GuardianLayer
out = GuardianLayer().deidentify_text_outputs(
"Contact Jane Smith at jane.smith@example.com or call (415) 555-0123.",
masking_type="transform",
)
print(out.outputs[0].text)
import { GuardianLayer } from "@custodianlabs/sdk";
const out = await new GuardianLayer().deidentifyTextOutputs(
"Contact Jane Smith at jane.smith@example.com or call (415) 555-0123.",
{ maskingType: "transform" },
);
console.log(out.outputs[0].text);
transform or redact
masking_type | Output |
|---|---|
transform (default) | Readable stand-in values |
redact | ***** |
Limit which entities
GuardianLayer().deidentify_text_outputs(text, pii_entities=["PERSON", "EMAIL_ADDRESS"])
Omit or ["ALL"] processes everything. See Supported Entities.
out.outputs holds one or two candidates; use outputs[0] by default.