Skip to content
Snippets Groups Projects
Select Git revision
  • b8c83784dfd541dbae8851a45c66a204d5cd82a7
  • main default protected
  • ud_training_script
  • fix_seed
  • merged-with-ner
  • multiword_fix_transformer
  • transformer_encoder
  • combo3
  • save_deprel_matrix_to_npz
  • master protected
  • combo-lambo
  • lambo-sent-attributes
  • adding_lambo
  • develop
  • update_allenlp2
  • develop_tmp
  • tokens_truncation
  • LR_test
  • eud_iwpt
  • iob
  • eud_iwpt_shared_task_bert_finetuning
  • 3.3.1
  • list
  • 3.2.1
  • 3.0.3
  • 3.0.1
  • 3.0.0
  • v1.0.6
  • v1.0.5
  • v1.0.4
  • v1.0.3
  • v1.0.2
  • v1.0.1
  • v1.0.0
34 results

train.py

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