ZINK is a Python package that enables zero-shot anonymization of entities in unstructured text. It offers a straightforward way to redact or replace sensitive information like names and phone numbers while preserving the utility of your data. The flexibility of entity labeling and ease of integration make ZINK a valuable tool for data privacy.
ZINK (Zero-shot Ink) is a robust Python package designed for the zero-shot anonymization of entities within unstructured text data. In an era where safeguarding sensitive information is critical, ZINK offers an efficient method for redacting or replacing personal details, including names, ages, phone numbers, and medical conditions, while preserving the overall utility of the text for analysis and processing.
[LABEL]_REDACTED) or substituting them with generic placeholders.Utilize the redact function to replace identified entities with [LABEL]_REDACTED.
import zink as pss
text = "John works as a doctor and plays football after work and drives a toyota."
labels = ("person", "profession", "sport", "car")
result = pss.redact(text, labels)
print(result.anonymized_text)
Example output:
person_REDACTED works as a profession_REDACTED and plays sport_REDACTED after work and drives a car_REDACTED.
Employ the replace function to substitute identified entities with random entities of the same type.
import zink as pss
text = "John Doe dialled his mother at 992-234-3456 and then went out for a walk."
labels = ("person", "phone number", "relationship")
result = pss.replace(text, labels)
print(result.anonymized_text)
Example output:
Warren Buffet dialled his Uncle at 2347789287 and then went out for a walk.
import zink as pss
text = "Patient, 33 years old, was admitted with a chest pain"
labels = ("age", "medical condition")
result = pss.replace(text, labels)
print(result.anonymized_text)
Example output:
Patient, 78 years old, was admitted with a Diabetes Mellitus.
ZINK stands out as a user-friendly and flexible solution for text anonymization, making it a valuable tool for developers and data scientists focused on data privacy.
No comments yet.
Sign in to be the first to comment.