mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
vectors: remove use of float as row number (#10955)
The float -1 was returned rather than the integer -1 as the row for unknown keys. This doesn't introduce a realy bug, since such floats cast (without issues) to int in the conversion to NumPy arrays. Still, it's nice to to do the correct thing :).
This commit is contained in:
parent
126d1db123
commit
0d352c46ed
|
@ -339,7 +339,7 @@ cdef class Vectors:
|
|||
return self.key2row.get(key, -1)
|
||||
elif keys is not None:
|
||||
keys = [get_string_id(key) for key in keys]
|
||||
rows = [self.key2row.get(key, -1.) for key in keys]
|
||||
rows = [self.key2row.get(key, -1) for key in keys]
|
||||
return xp.asarray(rows, dtype="i")
|
||||
else:
|
||||
row2key = {row: key for key, row in self.key2row.items()}
|
||||
|
|
Loading…
Reference in New Issue
Block a user