:py:mod:`medcat.utils.relation_extraction.modernbert.model` =========================================================== .. py:module:: medcat.utils.relation_extraction.modernbert.model Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: medcat.utils.relation_extraction.modernbert.model.ModernBertModel_RelationExtraction .. py:class:: ModernBertModel_RelationExtraction(pretrained_model_name_or_path, relcat_config, model_config) Bases: :py:obj:`medcat.utils.relation_extraction.models.BaseModel_RelationExtraction` ModernBertModel class for RelCAT .. py:attribute:: name :value: 'modernbertmodel_relcat' .. py:attribute:: log .. py:method:: __init__(pretrained_model_name_or_path, relcat_config, model_config) Class to hold the ModernBERT 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: ModernBertConfig_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.