def __init__(self, column_metadata, anonymize=False, category=None):
        """Initialize transformer."""

        super().__init__(column_metadata)

        self.anonymize = anonymize or column_metadata.get('pii')
        self.category = category or column_metadata.get('pii_category')

        self.probability_map = {}

        if self.anonymize:

            if self.category:
                self.get_generator()

            else:
                raise ValueError('`category` must be specified if `anonymize` is True')
def __init__ ( self , column_metadata , anonymize = False , category = None ) : super ( ) . __init__ ( column_metadata ) self . anonymize = anonymize or column_metadata . get ( 'pii' ) self . category = category or column_metadata . get ( 'pii_category' ) self . probability_map = { } if self . anonymize : if self . category : self . get_generator ( ) else : raise ValueError ( '`category` must be specified if `anonymize` is True' )
Initialize transformer.