From 5a65418c40979766832917400b99f6455a3df57e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 25 Jun 2018 22:28:59 +0200 Subject: [PATCH] Fix handling of unseen labels in tagger --- spacy/pipeline.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index d647cc8dc..e913b2647 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -501,7 +501,7 @@ class Tagger(Pipe): cdef int idx = 0 correct = numpy.zeros((scores.shape[0],), dtype='i') guesses = scores.argmax(axis=1) - known_labels = numpy.ones((scores.shape[0],), dtype='f') + known_labels = numpy.ones((scores.shape[0], 1), dtype='f') for gold in golds: for tag in gold.tags: if tag is None: