From d44bb45c72bd7fb936947d24c5bbca7d1a0311b2 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 1 May 2018 01:33:20 +0200 Subject: [PATCH] Fix scoring if tokenization changes --- spacy/scorer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/scorer.py b/spacy/scorer.py index 13be294c2..4e4a6d10d 100644 --- a/spacy/scorer.py +++ b/spacy/scorer.py @@ -86,7 +86,7 @@ class Scorer(object): def score(self, tokens, gold, verbose=False, punct_labels=('p', 'punct')): if len(tokens) != len(gold): - raise ValueError(Errors.E078.format(words_doc=len(tokens), words_gold=len(gold))) + gold = GoldParse.from_annot_tuples(tokens, zip(*gold.orig_annot)) gold_deps = set() gold_tags = set() gold_ents = set(tags_to_entities([annot[-1]