mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Merge branch 'develop' of https://github.com/explosion/spaCy into develop
This commit is contained in:
commit
e98eff275d
|
@ -88,8 +88,11 @@ def train(cmd, lang, output_dir, train_data, dev_data, n_iter=20, n_sents=0,
|
|||
with nlp.use_params(optimizer.averages):
|
||||
with (output_path / ('model%d.pickle' % i)).open('wb') as file_:
|
||||
dill.dump(nlp, file_, -1)
|
||||
with (output_path / ('model%d.pickle' % i)).open('rb') as file_:
|
||||
nlp_loaded = dill.load(file_)
|
||||
with (output_path / ('model%d.bin' % i)).open('wb') as file_:
|
||||
file_.write(nlp.to_bytes())
|
||||
with (output_path / ('model%d.bin' % i)).open('rb') as file_:
|
||||
nlp_loaded = lang_class(pipeline=pipeline)
|
||||
nlp_loaded.from_bytes(file_.read())
|
||||
scorer = nlp_loaded.evaluate(corpus.dev_docs(nlp_loaded, gold_preproc=False))
|
||||
print_progress(i, losses, scorer.scores)
|
||||
finally:
|
||||
|
|
|
@ -100,7 +100,7 @@ cdef cppclass StateC:
|
|||
ids[4] = this.E(0)-1
|
||||
else:
|
||||
ids[4] = -1
|
||||
if ids[3] < (this.length+1):
|
||||
if (ids[3]+1) < this.length:
|
||||
ids[5] = this.E(0)+1
|
||||
else:
|
||||
ids[5] = -1
|
||||
|
|
Loading…
Reference in New Issue
Block a user