mirror of https://github.com/explosion/spaCy.git
Fix Language.evaluate
This commit is contained in:
parent
0a566dc320
commit
0eec7c9e9b
|
@ -382,9 +382,13 @@ class Language(object):
|
||||||
return optimizer
|
return optimizer
|
||||||
|
|
||||||
def evaluate(self, docs_golds):
|
def evaluate(self, docs_golds):
|
||||||
docs, golds = zip(*docs_golds)
|
|
||||||
scorer = Scorer()
|
scorer = Scorer()
|
||||||
for doc, gold in zip(self.pipe(docs, batch_size=32), golds):
|
docs, golds = zip(*docs_golds)
|
||||||
|
docs = list(docs)
|
||||||
|
golds = list(golds)
|
||||||
|
for pipe in self.pipeline:
|
||||||
|
docs = pipe.pipe(docs)
|
||||||
|
for doc, gold in zip(docs, golds):
|
||||||
scorer.score(doc, gold)
|
scorer.score(doc, gold)
|
||||||
doc.tensor = None
|
doc.tensor = None
|
||||||
return scorer
|
return scorer
|
||||||
|
|
Loading…
Reference in New Issue