'Tries to retrieve a component from the cache, calls `create` to create a new component.'

def create_component(self, component_name, config):

    from rasa_nlu import registry
    from rasa_nlu.model import Metadata
    try:
        (component, cache_key) = self.__get_cached_component(component_name, Metadata(config.as_dict(), None))
        if (component is None):
            component = registry.create_component_by_name(component_name, config)
            self.__add_to_cache(component, cache_key)
        return component
    except MissingArgumentError as e:
        raise Exception(u"Failed    to    create    component    '{}'.    {}".format(component_name, e))
