From 664f2dd1c014ecf51895a8dab0ad5e909413007f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 25 Nov 2016 09:02:49 -0600 Subject: [PATCH] Allow dep to be None in scorer, for missing labels. --- spacy/scorer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/scorer.py b/spacy/scorer.py index c668845e5..3f8d73e6a 100644 --- a/spacy/scorer.py +++ b/spacy/scorer.py @@ -87,7 +87,7 @@ class Scorer(object): gold_ents = set(tags_to_entities([annot[-1] for annot in gold.orig_annot])) for id_, word, tag, head, dep, ner in gold.orig_annot: gold_tags.add((id_, tag)) - if dep.lower() not in punct_labels: + if dep is not None and dep.lower() not in punct_labels: gold_deps.add((id_, head, dep.lower())) cand_deps = set() cand_tags = set()