:py:mod:`medcat.utils.relation_extraction.bert.model` ===================================================== .. py:module:: medcat.utils.relation_extraction.bert.model Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: medcat.utils.relation_extraction.bert.model.BertModel_RelationExtraction .. py:class:: BertModel_RelationExtraction(pretrained_model_name_or_path, relcat_config, model_config) Bases: :py:obj:`medcat.utils.relation_extraction.models.BaseModel_RelationExtraction` BertModel class for RelCAT .. py:attribute:: name :value: 'bertmodel_relcat' .. py:attribute:: log .. py:method:: __init__(pretrained_model_name_or_path, relcat_config, model_config) Class to hold the BERT model + model_config :param pretrained_model_name_or_path: path to load the model from, this can be a HF model i.e: "bert-base-uncased", if left empty, it is normally assumed that a model is loaded from 'model.dat' using the RelCAT.load() method. So if you are initializing/training a model from scratch be sure to base it on some model. :type pretrained_model_name_or_path: str :param relcat_config: relcat config. :type relcat_config: ConfigRelCAT :param model_config: HF bert config for model. :type model_config: Union[BaseConfig_RelationExtraction | BertConfig_RelationExtraction] .. py:method:: load(pretrained_model_name_or_path, relcat_config, model_config, **kwargs) :classmethod: Load the model from the given path :param pretrained_model_name_or_path: path to load the model from. :type pretrained_model_name_or_path: str :param relcat_config: relcat config. :type relcat_config: ConfigRelCAT :param model_config: The model-specific config. :type model_config: BaseConfig_RelationExtraction :returns: **BaseModel_RelationExtraction** -- The loaded model.