:py:mod:`medcat.utils.relation_extraction.base_component` ========================================================= .. py:module:: medcat.utils.relation_extraction.base_component Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: medcat.utils.relation_extraction.base_component.BaseComponent_RelationExtraction Attributes ~~~~~~~~~~ .. autoapisummary:: medcat.utils.relation_extraction.base_component.logger .. py:data:: logger .. py:class:: BaseComponent_RelationExtraction(tokenizer = BaseTokenizerWrapper_RelationExtraction(), model = None, model_config = None, config = ConfigRelCAT(), task = 'train', init_model = False) .. py:attribute:: name :value: 'base_component_rel' .. py:method:: __init__(tokenizer = BaseTokenizerWrapper_RelationExtraction(), model = None, model_config = None, config = ConfigRelCAT(), task = 'train', init_model = False) Component that holds the model and everything for RelCAT. :param tokenizer: The base tokenizer for RelCAT. :type tokenizer: BaseTokenizerWrapper_RelationExtraction :param model: The model wrapper. :type model: BaseModel_RelationExtraction :param model_config: The model-specific config. :type model_config: BaseConfig_RelationExtraction :param config: The RelCAT config. :type config: ConfigRelCAT :param task: The task - used for checkpointing. :type task: str :param init_model: Loads default BERT base model, tokenizer, model config. Defaults to False. :type init_model: bool .. py:method:: save(save_path) Saves model and its dependencies to specified save_path folder. The CDB is obviously not saved, it is however necessary to save the tokenizer used. :param save_path: folder path in which to save the model & deps. :type save_path: str .. py:method:: load(pretrained_model_name_or_path = './') :classmethod: :param pretrained_model_name_or_path: Path to RelCAT model. Defaults to "./". :type pretrained_model_name_or_path: str :Returns: **BaseComponent_RelationExtraction** -- component.