mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Use averaged params for evaluation
This commit is contained in:
parent
7811d97339
commit
e14533757b
|
@ -53,7 +53,8 @@ def train(lang_id, output_dir, train_data, dev_data, n_iter, n_sents,
|
||||||
golds = list(golds)
|
golds = list(golds)
|
||||||
nlp.update(docs, golds, drop=dropout, sgd=optimizer)
|
nlp.update(docs, golds, drop=dropout, sgd=optimizer)
|
||||||
pbar.update(len(docs))
|
pbar.update(len(docs))
|
||||||
scorer = nlp.evaluate(corpus.dev_docs(nlp))
|
with nlp.use_params(optimizer.averages):
|
||||||
|
scorer = nlp.evaluate(corpus.dev_docs(nlp))
|
||||||
print_progress(i, {}, scorer.scores)
|
print_progress(i, {}, scorer.scores)
|
||||||
with (output_path / 'model.bin').open('wb') as file_:
|
with (output_path / 'model.bin').open('wb') as file_:
|
||||||
dill.dump(nlp, file_, -1)
|
dill.dump(nlp, file_, -1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user