sgnlp.models.ufd.utils.load_trained_models¶
-
load_trained_models
(cfg: sgnlp.models.ufd.data_class.UFDArguments, source_domain: str, target_language: str, target_domain: str) → Tuple[sgnlp.models.ufd.modeling.UFDAdaptorDomainModel, sgnlp.models.ufd.modeling.UFDAdaptorGlobalModel, sgnlp.models.ufd.modeling.UFDCombineFeaturesMapModel, sgnlp.models.ufd.modeling.UFDClassifierModel][source]¶ - Helper function to load pretrained config and model weights for both supervised and unsupervised
models.
- Parameters
cfg (UFDArguments) – UFDArguments config load from configuration file
source_domain (str) – name of source domain
target_language (str) – name of target language
target_domain (str) – name of target domain
- Returns
return all supervised, unsupervised models with pretrained weights loaded.
- Return type
Tuple[ UFDAdaptorDomainModel, UFDAdaptorGlobalModel, UFDCombineFeaturesMapModel, UFDClassifierModel, ]