mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
* Upd train script
This commit is contained in:
parent
08ca5c8970
commit
df749f257d
|
@ -9,7 +9,6 @@ import codecs
|
|||
import random
|
||||
import time
|
||||
import gzip
|
||||
import nltk
|
||||
|
||||
import plac
|
||||
import cProfile
|
||||
|
@ -219,10 +218,12 @@ def train(Language, paragraphs, model_dir, n_iter=15, feat_set=u'basic', seed=0,
|
|||
|
||||
|
||||
def evaluate(Language, dev_loc, model_dir, gold_preproc=False):
|
||||
global loss
|
||||
nlp = Language()
|
||||
n_corr = 0
|
||||
total = 0
|
||||
skipped = 0
|
||||
loss = 0
|
||||
with codecs.open(dev_loc, 'r', 'utf8') as file_:
|
||||
paragraphs = read_docparse_gold(file_)
|
||||
for tokens, tag_strs, heads, labels in iter_data(paragraphs, nlp.tokenizer,
|
||||
|
|
Loading…
Reference in New Issue
Block a user