Allow dep to be None in scorer, for missing labels.

This commit is contained in:
Matthew Honnibal 2016-11-25 09:02:49 -06:00
parent 39341598bb
commit 664f2dd1c0

View File

@ -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()