From 53eb96db0908cb9884dec3cfcdc591ea2f134488 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 25 Sep 2018 22:12:32 +0200 Subject: [PATCH] Fix definition of morphology model --- spacy/_ml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/_ml.py b/spacy/_ml.py index f37938671..813f5ab7f 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -524,8 +524,8 @@ def build_morphologizer_model(class_nums, **cfg): tok2vec = Tok2Vec(token_vector_width, embed_size, subword_features=subword_features, pretrained_vectors=pretrained_vectors) - softmax = with_flatten( - MultiSoftmax(class_nums, token_vector_width)) + softmax = with_flatten(MultiSoftmax(class_nums, token_vector_width)) + softmax.out_sizes = class_nums model = ( tok2vec >> softmax