mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Restore vector usage in models
This commit is contained in:
parent
3659a807b0
commit
8075726838
10
spacy/_ml.py
10
spacy/_ml.py
|
@ -208,11 +208,11 @@ class PrecomputableAffine(Model):
|
|||
def link_vectors_to_models(vocab):
|
||||
vectors = vocab.vectors
|
||||
ops = Model.ops
|
||||
#for word in vocab:
|
||||
# if word.orth in vectors.key2row:
|
||||
# word.rank = vectors.key2row[word.orth]
|
||||
# else:
|
||||
# word.rank = 0
|
||||
for word in vocab:
|
||||
if word.orth in vectors.key2row:
|
||||
word.rank = vectors.key2row[word.orth]
|
||||
else:
|
||||
word.rank = 0
|
||||
data = ops.asarray(vectors.data)
|
||||
# Set an entry here, so that vectors are accessed by StaticVectors
|
||||
# (unideal, I know)
|
||||
|
|
Loading…
Reference in New Issue
Block a user