Transform: Entity Label Redaction¶
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”.
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.