Fix handling of unseen labels in tagger

This commit is contained in:
Matthew Honnibal 2018-06-25 22:28:59 +02:00
parent 5b56aad4c2
commit 5a65418c40

View File

@ -501,7 +501,7 @@ class Tagger(Pipe):
cdef int idx = 0 cdef int idx = 0
correct = numpy.zeros((scores.shape[0],), dtype='i') correct = numpy.zeros((scores.shape[0],), dtype='i')
guesses = scores.argmax(axis=1) 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 gold in golds:
for tag in gold.tags: for tag in gold.tags:
if tag is None: if tag is None: