Add default name and lang to meta

This commit is contained in:
Matthew Honnibal 2017-10-11 08:49:12 +02:00
parent fd47f8e89f
commit 74c2c6a58c

View File

@ -68,6 +68,8 @@ def train(cmd, lang, output_dir, train_data, dev_data, n_iter=10, n_sents=0,
if not isinstance(meta, dict): if not isinstance(meta, dict):
prints("Expected dict but got: {}".format(type(meta)), prints("Expected dict but got: {}".format(type(meta)),
title="Not a valid meta.json format", exits=1) title="Not a valid meta.json format", exits=1)
meta.setdefault('lang', lang)
meta.setdefault('name', 'unnamed')
pipeline = ['tagger', 'parser', 'ner'] pipeline = ['tagger', 'parser', 'ner']
if no_tagger and 'tagger' in pipeline: pipeline.remove('tagger') if no_tagger and 'tagger' in pipeline: pipeline.remove('tagger')