'Persists the metadata of a model to a given directory.'

def persist(self, model_dir):

    metadata = self.metadata.copy()
    metadata.update({u'trained_at': datetime.datetime.now().strftime(u'%Y%m%d-%H%M%S'), u'rasa_nlu_version': rasa_nlu.__version__})
    with io.open(os.path.join(model_dir, u'metadata.json'), u'w') as f:
        f.write(str(json.dumps(metadata, indent=4)))
