'Persist all components of the pipeline to the passed path. Returns the directory of the persisted model.'

def persist(self, path, persistor=None, model_name=None):

    timestamp = datetime.datetime.now().strftime(u'%Y%m%d-%H%M%S')
    metadata = {u'language': self.config[u'language'], u'pipeline': [component.name for component in self.pipeline]}
    if (model_name is None):
        dir_name = os.path.join(path, (u'model_' + timestamp))
    else:
        dir_name = os.path.join(path, model_name)
    create_dir(dir_name)
    if self.training_data:
        metadata.update(self.training_data.persist(dir_name))
    for component in self.pipeline:
        update = component.persist(dir_name)
        if update:
            metadata.update(update)
    Metadata(metadata, dir_name).persist(dir_name)
    if (persistor is not None):
        persistor.save_tar(dir_name)
    logger.info(u"Successfully    saved    model    into    '{}'".format(os.path.abspath(dir_name)))
    return dir_name
