有什么方法可以让我在doc2vec中得到每段的等价向量列表?

问题描述 投票:0回答:1

有没有办法让我在doc2vec中看到每段的向量,而不是词汇表中的每个词。通过使用 model.wv.vectors 我得到了每个词的所有向量。现在,我需要这个来对嵌入的段落应用聚类算法,我希望可以得到。不过我不确定这种方法是否可行。这是段落的样子。

[TaggedDocument(words=['this', 'is', 'the', 'effect', 'of', 'those', 'states', 'that', 'went', 'into', 'lockdown', 'much', 'later', 'they', 'are', 'just', 'starting', 'to', 'see', 'the', 'large', 'increase', 'now', 'they', 'have', 'to', 'ride', 'it', 'out', 'and', 'hope', 'for', 'the', 'best'], tags=[0])

TaggedDocument(words=['so', 'see', 'the', 'headline', 'is', 'died', 'not', 'revised', 'predictions', 'show', 'more', 'hopeful', 'situation', 'or', 'new', 'york', 'reaching', 'apex', 'long', 'before', 'experts', 'predicted', 'or', 'any', 'such', 'thing', 'got', 'to', 'keep', 'the', 'panic', 'train', 'rolling', 'see'], tags=[1])]

python doc2vec
1个回答
0
投票

model.docvecs.vectors 将包含所有训练好的文档向量。

© www.soinside.com 2019 - 2024. All rights reserved.