Exemplo n.º 1
0
def load_component_by_name(component_name, context, config):
    # type: (Text, Dict[Text, Any], Dict[Text, Any]) -> Optional[Component]
    """Resolves a components name and calls it's load method to init it based on a previously persisted model."""
    from rasa_nlu.components import load_component

    component_clz = get_component_class(component_name)
    return load_component(component_clz, context, config)
Exemplo n.º 2
0
def load_component_by_name(component_name, context, config):
    # type: (Text, Dict[Text, Any], Dict[Text, Any]) -> Optional[Component]
    """Resolves a components name and calls it's load method to init it based on a previously persisted model."""
    from rasa_nlu.components import load_component

    component_clz = get_component_class(component_name)
    return load_component(component_clz, context, config)
Exemplo n.º 3
0
def test_load_can_handle_none():
    assert load_component(None, {}, {}) is None
Exemplo n.º 4
0
def test_load_can_handle_none():
    assert load_component(None, {}, {}) is None