Transform: Entity Label Redaction

class gretel_client.transformers.transformers.redact_with_label.RedactWithLabel(config: gretel_client.transformers.base.TransformerConfig)
config_class

alias of RedactWithLabelConfig

class gretel_client.transformers.transformers.redact_with_label.RedactWithLabelConfig(labels: List[str] = None, minimum_score: Optional[float] = None)

Redact a string with the name of an entity label that represents that data. This transformer is best used with already labeled data from the Gretel API. If you created a version of this transformer to redact an email address, then each email address would be replaced with “EMAIL_ADDRESS”.

Example:

xf = RedactWithLabelConfig(labels=["email_address"])

If this is used as a field transformer, the transformer will attempt to find any entity label metadata for that field. If found, the first label observed will be the string used for the redaction. The entire field contents will be replaced with the redaction.