Constants
gllm_privacy.pii_detector.constants
Constants used in the pii_detector module.
References
NONE
DEFAULT_PROSA_SUPPORTED_PII_ENTITIES = [Entities.PERSON, Entities.ORGANIZATION_NAME, Entities.LOCATION]
module-attribute
GLLM_PRIVACY_ENTITIES = tuple(entity.value for entity in Entities)
module-attribute
PROSA_ENTITY_MAP = {'OTN': Entities.OTHER_NAME, 'PER': Entities.PERSON, 'GOD': Entities.GOD, 'ORG': Entities.ORGANIZATION_NAME, 'LOC': Entities.LOCATION, 'FAC': Entities.FACILITY, 'PRO': Entities.PRODUCT, 'EVT': Entities.EVENT, 'TME': Entities.TIME, 'DTE': Entities.DATE_TIME, 'NUM': Entities.NUMBER, 'MEA': Entities.MEASUREMENT}
module-attribute
RecognizerResult = PresidioRecognizerResult
module-attribute
Entities
Bases: StrEnum
Supported entities for PII detection.
BANK_ACCOUNT = 'BANK_ACCOUNT'
class-attribute
instance-attribute
CREDIT_CARD = 'CREDIT_CARD'
class-attribute
instance-attribute
CRYPTO = 'CRYPTO'
class-attribute
instance-attribute
DATE_TIME = 'DATE_TIME'
class-attribute
instance-attribute
EMAIL_ADDRESS = 'EMAIL_ADDRESS'
class-attribute
instance-attribute
EMPLOYEE_ID = 'EMPLOYEE_ID'
class-attribute
instance-attribute
EVENT = 'EVENT'
class-attribute
instance-attribute
FACEBOOK_ACCOUNT = 'FACEBOOK_ACCOUNT'
class-attribute
instance-attribute
FACILITY = 'FACILITY'
class-attribute
instance-attribute
FAMILY_CARD_NUMBER = 'FAMILY_CARD_NUMBER'
class-attribute
instance-attribute
GOD = 'GOD'
class-attribute
instance-attribute
IBAN_CODE = 'IBAN_CODE'
class-attribute
instance-attribute
ID_BPJS_NUMBER = 'ID_BPJS_NUMBER'
class-attribute
instance-attribute
IP_ADDRESS = 'IP_ADDRESS'
class-attribute
instance-attribute
KTP = 'ID_KTP'
class-attribute
instance-attribute
LINKEDIN_ACCOUNT = 'LINKEDIN_ACCOUNT'
class-attribute
instance-attribute
LOCATION = 'LOCATION'
class-attribute
instance-attribute
MEASUREMENT = 'MEASUREMENT'
class-attribute
instance-attribute
MEDICAL_LICENSE = 'MEDICAL_LICENSE'
class-attribute
instance-attribute
MONEY = 'MONEY'
class-attribute
instance-attribute
NPWP = 'ID_NPWP'
class-attribute
instance-attribute
NRP = 'NRP'
class-attribute
instance-attribute
NUMBER = 'NUMBER'
class-attribute
instance-attribute
ORGANIZATION_NAME = 'ORGANIZATION'
class-attribute
instance-attribute
OTHER_NAME = 'OTHER_NAME'
class-attribute
instance-attribute
PERSON = 'PERSON'
class-attribute
instance-attribute
PHONE_NUMBER = 'PHONE_NUMBER'
class-attribute
instance-attribute
PRODUCT = 'PRODUCT'
class-attribute
instance-attribute
PROJECT = 'PROJECT'
class-attribute
instance-attribute
TIME = 'TIME'
class-attribute
instance-attribute
URL = 'URL'
class-attribute
instance-attribute
US_BANK_NUMBER = 'US_BANK_NUMBER'
class-attribute
instance-attribute
US_DRIVER_LICENSE = 'US_DRIVER_LICENSE'
class-attribute
instance-attribute
US_ITIN = 'US_ITIN'
class-attribute
instance-attribute
US_PASSPORT = 'US_PASSPORT'
class-attribute
instance-attribute
US_SSN = 'US_SSN'
class-attribute
instance-attribute
ProsaNERConstant
Defines constants used in the Prosa NER integration.
This class encapsulates various constants that are utilized throughout the Prosa Named Entity Recognition (NER) integration process. These include API headers, API payload keys and values, entity recognition response keys, and default values for entity recognition processing.
Attributes:
Name | Type | Description |
---|---|---|
HEADER_CONTENT_TYPE_KEY |
str
|
Key for the content type header. |
HEADER_CONTENT_TYPE_VAL |
str
|
Value for the 'Content-Type' header, typically 'application/json'. |
HEADER_USER_AGENT |
str
|
Key for the user agent header. |
HEADER_USER_AGENT_VAL |
str
|
Value for User-Agent HTTP header for request. |
ID_LANGUAGE |
str
|
Language code for Indonesian language, used in language-specific operations. |
VERSION_CUSTOM_NER |
str
|
Version identifier for the custom NER being used. |
PAYLOAD_VERSION_KEY |
str
|
Key for specifying the version in the API payload. |
PAYLOAD_VERSION_VAL |
str
|
Value for the API version, typically 'v1'. |
PAYLOAD_TEXT_KEY |
str
|
Key for the text to be analyzed in the API payload. |
RESPONSE_TIMEOUT |
int
|
Timeout value for the API response, in seconds. |
ENTITY_TYPE_KEY |
str
|
Key for the entity type in entity dictionaries. |
START_KEY |
str
|
Key for the start index of an entity in the text. |
START_IDX_KEY |
str
|
Key for the start index of an entity in the text returned by Prosa. |
END_KEY |
str
|
Key for the end index of an entity in the text. |
SCORE_KEY |
str
|
Key for the confidence score of the entity recognition. |
DEFAULT_SCORE |
float
|
Default score assigned to recognized entities if not provided. |
RECOGNITION_METADATA_KEY |
str
|
Key for additional metadata associated with recognized entities. |
NAME_KEY |
str
|
Key for the entity's name within the recognition metadata. |
ENTITY_KEY |
str
|
Key for accessing entity string from the API response. |