Updated on December 4, 2023

Mask with AutoDetect

This method automatically identifies and masks personal/sensitive data within a specific text.

  • The ProtectoVault object is instantiated with your tokenization key.
  • The input should consist of a list of values to be masked.
  • The mask method is used to automatically identify and mask personal/sensitive data within the provided text.

Note: To obtain the <auth token>, please refer to the Step-by-Step Guide to Obtain Your Auth Token.

Code Snippet

# Import the ProtectoVault class from the protecto_ai module
from protecto_ai import ProtectoVault
# Create an instance of ProtectoVault with your authentication token
obj = ProtectoVault("<auth_token>")
# Pass a list of sensitive information as input for the mask method
result = obj.mask(["George Washington is happy", "Mark lives in the U.S.A"])
# Print the masked result
print(result)

Result

{ 
  "data": [ 
    { 
      "value": "George Washington is happy", 
      "token_value": "<PER>wRePE302Qx vUc7DruuWm</PER> is happy", 
      "individual_tokens": [ 
        { 
          "value": "George Washington", 
          "pii_type": "PERSON", 
          "token": "wRePE302Qx vUc7DruuWm", 
          "prefix": "<PER>", 
          "suffix": "</PER>" 
        } 
    ] 
    }, 
    { 
      "value": "Mark lives in the U.S.A", 
      "token_value": "<PER>7FHnu7Uo2O</PER> lives in the <ADDRESS>oQLxg3gisk.G2jPUYZHcv.bHIrJ0Mb7k</ADDRESS>", 
      "individual_tokens": [ 
        { 
          "value": "Mark", 
          "pii_type": "PERSON", 
          "token": "7FHnu7Uo2O", 
          "prefix": "<PER>", 
          "suffix": "</PER>" 
        }, 
        { 
          "value": "U.S.A", 
          "pii_type": "GPE", 
          "token": "oQLxg3gisk.G2jPUYZHcv.bHIrJ0Mb7k", 
          "prefix": "<ADDRESS>", 
          "suffix": "</ADDRESS>" 
        } 
      ] 
    } 
  ], 
  "success": true, 
  "error": { 
    "message": "" 
  } 
} 

For more comprehensive information about our product, kindly reach out to us through our website at https://www.protecto.ai/.

What are your feelings
Scroll to Top