mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
* Fix vectors bug in lexeme
This commit is contained in:
parent
22a1ad8a55
commit
191d593e03
|
@ -54,12 +54,12 @@ cdef class Lexeme:
|
||||||
|
|
||||||
property vector:
|
property vector:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
cdef int length = self.vocab.vector_length
|
cdef int length = self.vocab.vectors_length
|
||||||
repvec_view = <float[:length,]>self.c.repvec
|
repvec_view = <float[:length,]>self.c.repvec
|
||||||
return numpy.asarray(repvec_view)
|
return numpy.asarray(repvec_view)
|
||||||
|
|
||||||
def __set__(self, vector):
|
def __set__(self, vector):
|
||||||
assert len(vector) == self.vocab.vector_length
|
assert len(vector) == self.vocab.vectors_length
|
||||||
cdef float value
|
cdef float value
|
||||||
for i, value in enumerate(vector):
|
for i, value in enumerate(vector):
|
||||||
self.c.repvec[i] = value
|
self.c.repvec[i] = value
|
||||||
|
|
Loading…
Reference in New Issue
Block a user