veil.entity_detectors.api¶
- class veil.entity_detectors.api.HostedMaskerApiEntityDetector(cfg)[source]¶
Bases:
MaskerApiEntityDetectorAnonymizer backed by a hosted Masker API. Wrapper around MaskerApiEntityDetector with specific entity types.
- Parameters:
- ENTITY_TYPES: Set[EntityTypeBase] = {HostedMaskerApiEntityType.NAME, HostedMaskerApiEntityType.ADDRESS, HostedMaskerApiEntityType.COMPANY}¶
- chunk_char_limit: int¶
- chunk_on_truncation: bool¶
- frequency_penalty: float¶
- headers: Dict[str, str]¶
- max_tokens: int¶
- model: str | None¶
- presence_penalty: float¶
- retries: int¶
- retry_backoff_base: float¶
- retry_on_truncation: bool¶
- system_prompt: str | None¶
- temperature: float¶
- timeout: float¶
- top_k: int¶
- top_p: float¶
- truncation_min_fraction: float¶
- class veil.entity_detectors.api.MaskerApiEntityDetector(cfg)[source]¶
Bases:
BaseEntityDetector[EntityTypeBase]- Parameters:
- ENTITY_TYPES: Set[EntityTypeBase]¶
- detect_entities(doc)[source]¶
Detect entities by delegating to a remote masking API and parsing its masked output.
- Parameters:
doc (Document)
- Return type:
List[Span]