Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gensim get topic for a document (seen document)

Tags:

python

gensim

lda

I know that after training the lda model for gensim, we can get the topic for an unseen document by:

lda = LdaModel(corpus, num_topics=10)
doc_lda = lda[doc_bow]

But how about the documents that are already used for training? I mean is there a way to get the topic for a document in corpus that was used in training without treating it like a new document?

like image 260
CentAu Avatar asked Apr 12 '14 15:04

CentAu


1 Answers

No.

Information from individual documents is distilled into the model, then forgotten. No per-document information is kept (more generally: no information that would require O(#docs) memory is kept).

like image 67
Radim Avatar answered Nov 12 '22 08:11

Radim