mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
* Ensure tagger and NER are trained, even if non-projective problem
This commit is contained in:
parent
f69fe6a635
commit
895060e774
|
@ -84,15 +84,13 @@ def train(Language, gold_tuples, model_dir, n_iter=15, feat_set=u'basic', seed=0
|
|||
loss += nlp.parser.train(tokens, gold)
|
||||
except AssertionError:
|
||||
# TODO: Do something about non-projective sentences
|
||||
continue
|
||||
if gold.ents:
|
||||
nlp.entity.train(tokens, gold)
|
||||
pass
|
||||
nlp.entity.train(tokens, gold)
|
||||
nlp.tagger.train(tokens, gold.tags)
|
||||
|
||||
random.shuffle(gold_tuples)
|
||||
print '%d:\t%d\t%.3f\t%.3f\t%.3f\t%.3f' % (itn, loss, scorer.uas, scorer.ents_f,
|
||||
scorer.tags_acc,
|
||||
scorer.token_acc)
|
||||
random.shuffle(gold_tuples)
|
||||
nlp.parser.model.end_training()
|
||||
nlp.entity.model.end_training()
|
||||
nlp.tagger.model.end_training()
|
||||
|
|
Loading…
Reference in New Issue
Block a user