  Protecting Personal Identifiable Information (PII) in text data is crucial
for privacy, but current PII generalization methods face challenges such as
uneven data distributions and limited context awareness. To address these
issues, we propose two approaches: a feature-based method using machine
learning to improve performance on structured inputs, and a novel context-aware
framework that considers the broader context and semantic relationships between
the original text and generalized candidates. The context-aware approach
employs Multilingual-BERT for text representation, functional transformations,
and mean squared error scoring to evaluate candidates. Experiments on the
WikiReplace dataset demonstrate the effectiveness of both methods, with the
context-aware approach outperforming the feature-based one across different
scales. This work contributes to advancing PII generalization techniques by
highlighting the importance of feature selection, ensemble learning, and
incorporating contextual information for better privacy protection in text
anonymization.
