mirror of https://github.com/explosion/spaCy.git
Merge branch 'develop' of https://github.com/explosion/spaCy into develop
This commit is contained in:
commit
9a5e7c6fe2
|
@ -276,7 +276,10 @@ cdef class Vectors:
|
||||||
sims = xp.dot(batch, vectors.T)
|
sims = xp.dot(batch, vectors.T)
|
||||||
best_rows[i:i+batch_size] = sims.argmax(axis=1)
|
best_rows[i:i+batch_size] = sims.argmax(axis=1)
|
||||||
scores[i:i+batch_size] = sims.max(axis=1)
|
scores[i:i+batch_size] = sims.max(axis=1)
|
||||||
keys = self.find(rows=best_rows)
|
|
||||||
|
xp = get_array_module(self.data)
|
||||||
|
row2key = {row: key for key, row in self.key2row.items()}
|
||||||
|
keys = xp.asarray([row2key[row] for row in best_rows], dtype='uint64')
|
||||||
return (keys, best_rows, scores)
|
return (keys, best_rows, scores)
|
||||||
|
|
||||||
def from_glove(self, path):
|
def from_glove(self, path):
|
||||||
|
|
Loading…
Reference in New Issue