'Persist this model into the passed directory. Returns the metadata necessary to load the model again.'

def persist(self, model_dir):

    from sklearn.externals import joblib
    if self.ent_tagger:
        model_file_name = os.path.join(model_dir, u'crf_model.pkl')
        joblib.dump(self.ent_tagger, model_file_name)
        return {u'entity_extractor_crf': {u'model_file': u'crf_model.pkl', u'crf_features': self.crf_features, u'BILOU_flag': self.BILOU_flag, u'version': 1}}
    else:
        return {u'entity_extractor_crf': None}
