mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix vector norm when loading lexemes.
This commit is contained in:
parent
c05cd2356e
commit
6036ec7c77
|
@ -449,6 +449,7 @@ cdef class Vocab:
|
|||
lex = <LexemeC*>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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user