veil.config.entity_detectors

Classes

BaseEntityDetectorConfig([priority, ...])

Marker base for entity detector configuration objects.

GlinerEntityDetectorConfig([priority, ...])

Configuration for the Gliner entity detector integration.

HostedMaskerApiEntityDetectorConfig([...])

Configuration for the hosted Masker API entity detector integration.

MaskerApiEntityDetectorConfig([priority, ...])

Marker base for masking-API entity detector configuration objects.

RegexEntityDetectorConfig([priority, ...])

Configuration wrapper for Veil’s RegexEntityDetector engine.

SpacyEntityDetectorConfig([priority, ...])

Configuration for the Spacy entity detector integration.

class veil.config.entity_detectors.BaseEntityDetectorConfig(priority=<factory>, hierarchy_position=0)[source]

Bases: BasePolyConfig

Marker base for entity detector configuration objects.

Parameters:
  • priority (Dict[str, int])

  • hierarchy_position (int)

classmethod get_type()[source]
hierarchy_position: int = 0
priority: Dict[str, int]
class veil.config.entity_detectors.GlinerEntityDetectorConfig(priority=<factory>, hierarchy_position=0, labels=<factory>, model='urchade/gliner_multi-v2.1', cuda_device=0, threshold=0.6, batch_size=8, max_length=384, chunk_overlap=50, nms_iou_threshold=0.8, min_span_chars=3, max_span_chars=80, top_k_per_chunk=100)[source]

Bases: BaseEntityDetectorConfig

Configuration for the Gliner entity detector integration.

Parameters:
  • priority (Dict[str, int])

  • hierarchy_position (int)

  • labels (List[str])

  • model (str)

  • cuda_device (int)

  • threshold (float)

  • batch_size (int)

  • max_length (int)

  • chunk_overlap (int)

  • nms_iou_threshold (float)

  • min_span_chars (int)

  • max_span_chars (int)

  • top_k_per_chunk (int)

batch_size: int = 8
chunk_overlap: int = 50
cuda_device: int = 0
classmethod get_type()[source]
labels: List[str]
max_length: int = 384
max_span_chars: int = 80
min_span_chars: int = 3
model: str = 'urchade/gliner_multi-v2.1'
nms_iou_threshold: float = 0.8
priority: Dict[str, int]
threshold: float = 0.6
top_k_per_chunk: int = 100
class veil.config.entity_detectors.HostedMaskerApiEntityDetectorConfig(priority=<factory>, hierarchy_position=0, api_url='', headers=<factory>, model='', system_prompt='You are a helpful assistant that masks sensitive information.', max_tokens=4000, top_p=1, top_k=40, presence_penalty=0, frequency_penalty=0, temperature=0.6, timeout=30, retries=2, retry_backoff_base=0.5, retry_on_truncation=True, chunk_on_truncation=True, chunk_char_limit=4000, truncation_min_fraction=0.6)[source]

Bases: MaskerApiEntityDetectorConfig

Configuration for the hosted Masker API entity detector integration.

Parameters:
  • priority (Dict[str, int])

  • hierarchy_position (int)

  • api_url (str)

  • headers (Dict[str, str])

  • model (str)

  • system_prompt (str)

  • max_tokens (int)

  • top_p (float)

  • top_k (int)

  • presence_penalty (float)

  • frequency_penalty (float)

  • temperature (float)

  • timeout (float)

  • retries (int)

  • retry_backoff_base (float)

  • retry_on_truncation (bool)

  • chunk_on_truncation (bool)

  • chunk_char_limit (int)

  • truncation_min_fraction (float)

classmethod get_type()[source]
class veil.config.entity_detectors.MaskerApiEntityDetectorConfig(priority=<factory>, hierarchy_position=0, api_url='', headers=<factory>, model='', system_prompt='You are a helpful assistant that masks sensitive information.', max_tokens=4000, top_p=1, top_k=40, presence_penalty=0, frequency_penalty=0, temperature=0.6, timeout=30, retries=2, retry_backoff_base=0.5, retry_on_truncation=True, chunk_on_truncation=True, chunk_char_limit=4000, truncation_min_fraction=0.6)[source]

Bases: BaseEntityDetectorConfig

Marker base for masking-API entity detector configuration objects.

Parameters:
  • priority (Dict[str, int])

  • hierarchy_position (int)

  • api_url (str)

  • headers (Dict[str, str])

  • model (str)

  • system_prompt (str)

  • max_tokens (int)

  • top_p (float)

  • top_k (int)

  • presence_penalty (float)

  • frequency_penalty (float)

  • temperature (float)

  • timeout (float)

  • retries (int)

  • retry_backoff_base (float)

  • retry_on_truncation (bool)

  • chunk_on_truncation (bool)

  • chunk_char_limit (int)

  • truncation_min_fraction (float)

api_url: str = ''
chunk_char_limit: int = 4000
chunk_on_truncation: bool = True
frequency_penalty: float = 0
classmethod get_type()[source]
headers: Dict[str, str]
max_tokens: int = 4000
model: str = ''
presence_penalty: float = 0
priority: Dict[str, int]
retries: int = 2
retry_backoff_base: float = 0.5
retry_on_truncation: bool = True
system_prompt: str = 'You are a helpful assistant that masks sensitive information.'
temperature: float = 0.6
timeout: float = 30
top_k: int = 40
top_p: float = 1
truncation_min_fraction: float = 0.6
class veil.config.entity_detectors.RegexEntityDetectorConfig(priority=<factory>, hierarchy_position=0, enable_validation=True, min_confidence=0.0, preserve_format=True, case_sensitive=False)[source]

Bases: BaseEntityDetectorConfig

Configuration wrapper for Veil’s RegexEntityDetector engine.

Parameters:
  • priority (Dict[str, int])

  • hierarchy_position (int)

  • enable_validation (bool)

  • min_confidence (float)

  • preserve_format (bool)

  • case_sensitive (bool)

case_sensitive: bool = False
enable_validation: bool = True
classmethod get_type()[source]
min_confidence: float = 0.0
preserve_format: bool = True
priority: Dict[str, int]
class veil.config.entity_detectors.SpacyEntityDetectorConfig(priority=<factory>, hierarchy_position=0, model='es_core_news_sm', cuda_device=0)[source]

Bases: BaseEntityDetectorConfig

Configuration for the Spacy entity detector integration.

Parameters:
  • priority (Dict[str, int])

  • hierarchy_position (int)

  • model (str)

  • cuda_device (int)

cuda_device: int = 0
classmethod get_type()[source]
model: str = 'es_core_news_sm'
priority: Dict[str, int]