I've trained Doc2Vec
model I'm trying to get predictions.
I use
test_data = word_tokenize("Филип Моррис Продактс С.А.".lower())
model = Doc2Vec.load(model_path)
v1 = model.infer_vector(test_data)
sims = model.docvecs.most_similar([v1])
print(sims)
returns
[('624319', 0.7534812092781067), ('566511', 0.7333904504776001), ('517382', 0.7264763116836548), ('523368', 0.7254455089569092), ('494248', 0.7212602496147156), ('382920', 0.7092794179916382), ('530910', 0.7086726427078247), ('513421', 0.6893941760063171), ('196931', 0.6776881814002991), ('196947', 0.6705600023269653)]
Next I've tried to know, what's text of this number
model.docvecs['624319']
But it returns me only the vector representation
array([ 0.36298314, -0.8048847 , -1.4890883 , -0.3737898 , -0.00292279,
-0.6606688 , -0.12611026, -0.14547637, 0.78830665, 0.6172428 ,
-0.04928801, 0.36754376, -0.54034036, 0.04631123, 0.24066721,
0.22503968, 0.02870891, 0.28329515, 0.05591608, 0.00457001],
dtype=float32)
So, is any way to get text of this label from the model? Loading train dataset takes a lot of time, so I try to find out another way.