Skip to content
Snippets Groups Projects
interface.py 575 B
Newer Older
Michał Pogoda's avatar
Michał Pogoda committed
from typing import List, Dict, Any, Tuple
from abc import ABC, abstractmethod
class Detector(ABC):
    @abstractmethod
Michał Pogoda's avatar
Michał Pogoda committed
    def detect(
        self, text: str, annotations: Dict[str, List[Tuple[int, int, Any]]]
    ) -> List[Tuple[int, int, Detection]]:
        """Detects entities in text

        Args:
            text (str): Text to be processed.
            annotations (Dict[str, List[Tuple[int, int, Any]]]): Annotations.

        Returns:
            List[Tuple[int, int, Detection]]: List of detections.
        """
        pass