From 29e3da64930434c178fba30cfbbc2f0b7a29e3c7 Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Fri, 18 Oct 2019 11:00:02 +0200 Subject: [PATCH] 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. --- spacy/scorer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/scorer.py b/spacy/scorer.py index 9c057d0a3..f9245a32f 100644 --- a/spacy/scorer.py +++ b/spacy/scorer.py @@ -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]))