用LDA模型计算文档相似度
Don’t know if this’ll help but, I managed to attain successful results on document matching and similarities when using the actual document as a query.
dictionary = corpora.Dictionary.load('dictionary.dict')
corpus = corpora.MmCorpus("corpus.mm")
lda = models.LdaModel.load("model.lda") #result from running online lda (training)
index = similarities.MatrixSimilarity(lda[corpus])
index.save("simIndex.index")
docname = "docs/the_doc.txt"
doc = open(docname, 'r').

该博客介绍了如何利用Gensim库中的LDA模型来计算文档之间的相似度,提到了Cosine相似度和Hellinger距离作为潜在的相似性度量方法。
最低0.47元/天 解锁文章

145

被折叠的 条评论
为什么被折叠?



