From 6036ec7c77129d258991b8f637bf20b46220f878 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 23 Oct 2016 19:40:18 +0200 Subject: [PATCH] Fix vector norm when loading lexemes. --- spacy/vocab.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 9bfd74046..b82a61906 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -449,6 +449,7 @@ cdef class Vocab: lex = lex_addr if lex.lower < vectors.size(): lex.vector = vectors[lex.lower] + norm = 0.0 for i in range(vec_len): norm += lex.vector[i] * lex.vector[i] lex.l2_norm = sqrt(norm)