Newer
Older
from abc import ABC, abstractmethod
"""Input parser interface.
Input parser is used to parse input standarized set of into text and annotations.
"""
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.:
Input
"She has a cat"
Output:
("She has a cat", {"entities": [(0, 3, "She"), (8, 11, "cat")]})
Returns:
Tuple[str, Dict[str, List[Tuple[int, int, Any]]]]: Text and annotations.