rasa/core/policies/ensemble.py
def load(cls, path: Text) -> 'PolicyEnsemble':
        """Loads policy and domain specification from storage"""

        metadata = cls.load_metadata(path)
        cls.ensure_model_compatibility(metadata)
        policies = []
        for i, policy_name in enumerate(metadata["policy_names"]):
            policy_cls = registry.policy_from_module_path(policy_name)
            dir_name = 'policy_{}_{}'.format(i, policy_cls.__name__)
            policy_path = os.path.join(path, dir_name)
            policy = policy_cls.load(policy_path)
            cls._ensure_loaded_policy(policy, policy_cls, policy_name)
            policies.append(policy)
        ensemble_cls = utils.class_from_module_path(metadata["ensemble_name"])
        fingerprints = metadata.get("action_fingerprints", {})
        ensemble = ensemble_cls(policies, fingerprints)
        return ensemble
Loads policy and domain specification from storage
Loads policy and domain specification from storage
Loads policy and domain specification from storage
def load(cls, path: Text) -> 'PolicyEnsemble':
        metadata = cls.load_metadata(path)
        cls.ensure_model_compatibility(metadata)
        policies = []
        for i, policy_name in enumerate(metadata["policy_names"]):
            policy_cls = registry.policy_from_module_path(policy_name)
            dir_name = 'policy_{}_{}'.format(i, policy_cls.__name__)
            policy_path = os.path.join(path, dir_name)
            policy = policy_cls.load(policy_path)
            cls._ensure_loaded_policy(policy, policy_cls, policy_name)
            policies.append(policy)
        ensemble_cls = utils.class_from_module_path(metadata["ensemble_name"])
        fingerprints = metadata.get("action_fingerprints", {})
        ensemble = ensemble_cls(policies, fingerprints)
        return ensemble
def load ( cls , path : Text ) -> 'PolicyEnsemble' : metadata = cls . load_metadata ( path ) cls . ensure_model_compatibility ( metadata ) policies = [ ] for i , policy_name in enumerate ( metadata [ "policy_names" ] ) : policy_cls = registry . policy_from_module_path ( policy_name ) dir_name = 'policy_{}_{}' . format ( i , policy_cls . __name__ ) policy_path = os . path . join ( path , dir_name ) policy = policy_cls . load ( policy_path ) cls . _ensure_loaded_policy ( policy , policy_cls , policy_name ) policies . append ( policy ) ensemble_cls = utils . class_from_module_path ( metadata [ "ensemble_name" ] ) fingerprints = metadata . get ( "action_fingerprints" , { } ) ensemble = ensemble_cls ( policies , fingerprints ) return ensemble
Loads policy and domain specification from storage
Loads policy and domain specification from storage
"""Loads policy and domain specification from storage"""
cls
path
Text