Newer
Older
from abc import ABC, abstractmethod
from typing import List, Tuple

Michał Pogoda
committed
from src.detections import Detection
class ReplacerInterface(ABC):
@abstractmethod
def replace(

Michał Pogoda
committed
self, text: str, detections: List[Tuple[int, int, Detection]]
) -> Tuple[str, List[Tuple[int, int, Detection]]]:
"""Replace detected entities in text with anonimized version.
Args:
text (str): Text to be processed.
detections (List[Tuple[int, int, str]]): List of detections.
Returns:
Tuple[str, List[Tuple[int, int, str]]]: Text with supported entities
replaced with anonimized version and list of detections that were