Restore vector usage in models

This commit is contained in:
Matthew Honnibal 2017-10-31 19:21:17 +01:00
parent 3659a807b0
commit 8075726838

View File

@ -208,11 +208,11 @@ class PrecomputableAffine(Model):
def link_vectors_to_models(vocab): def link_vectors_to_models(vocab):
vectors = vocab.vectors vectors = vocab.vectors
ops = Model.ops ops = Model.ops
#for word in vocab: for word in vocab:
# if word.orth in vectors.key2row: if word.orth in vectors.key2row:
# word.rank = vectors.key2row[word.orth] word.rank = vectors.key2row[word.orth]
# else: else:
# word.rank = 0 word.rank = 0
data = ops.asarray(vectors.data) data = ops.asarray(vectors.data)
# Set an entry here, so that vectors are accessed by StaticVectors # Set an entry here, so that vectors are accessed by StaticVectors
# (unideal, I know) # (unideal, I know)