Skip to content
Snippets Groups Projects
Select Git revision
  • change_data_model
  • main default protected
  • feature/add_auth_asr_service
  • fix/incorrect_import
  • feature/change_registry_clarin
  • feature/add_base_asr_service
  • feature/add_poetry
  • feature/add_word_ids
  • feature/add_sziszapangma
9 results

pos.ipynb

Blame
  • interface.py 641 B
    from typing import Dict, List, Tuple, Any
    from abc import ABC, abstractmethod
    
    
    class InputParser(ABC):
        @abstractmethod
        def parse(self, content: str) -> Tuple[str, List[Tuple[int, int, Any]]]:
            """Parse input string into text and annotations.
    
            Annotations are returned as a dictionary with channel name as a key and list of tuples.
            Eg.: "She has a cat" -> ("She has a cat", {"entities": [(0, 3, "She"), (8, 11, "cat")]})
    
            Args:
                content (str): Input in raw form.
    
            Returns:
                Tuple[str, Dict[str, List[Tuple[int, int, Any]]]]: Text and annotations.
            """
            pass