Add missing cats to gold annot_tuples in Scorer (#4466)

Add missing `cats` in `Scorer` call to `GoldParse.from_annot_tuples()`
when the `doc` and `gold` have differing lengths.
This commit is contained in:
adrianeboyd 2019-10-18 11:00:02 +02:00 committed by Matthew Honnibal
parent 135e3de531
commit 29e3da6493

View File

@ -219,7 +219,7 @@ class Scorer(object):
DOCS: https://spacy.io/api/scorer#score
"""
if len(doc) != len(gold):
gold = GoldParse.from_annot_tuples(doc, zip(*gold.orig_annot))
gold = GoldParse.from_annot_tuples(doc, tuple(zip(*gold.orig_annot)) + (gold.cats,))
gold_deps = set()
gold_tags = set()
gold_ents = set(tags_to_entities([annot[-1] for annot in gold.orig_annot]))