retrieve topic-word array & document-topic array from lda

1,024 views
Skip to first unread message

Anand Viswanathan

unread,
Sep 12, 2014, 5:00:03 PM9/12/14
to gen...@googlegroups.com



Situation:

I have a numpy term-document matrix example: [[0,1,0,0....],....[......0,0,0,0]].

I have plugged in the above matrix to the ldamodel method of the gensim. And it is working fine with the lad method lda = LdaModel(corpus, num_topics=10). corpus is my term-document matrix mentioned above. I needed two intermediate matrices( topic-word array & document-topic array) for research purpose.

1) per document topic probability matrix (p_d_t)

2) per topic word probability matrix (p_w_t)

Question:

How to get those arrays from the gensim LdaModel() function.?

Kindly help me with getting those matrices.

Radim Řehůřek

unread,
Sep 15, 2014, 10:06:32 AM9/15/14
to gen...@googlegroups.com
Hello Anand,

have a look at this thread: https://groups.google.com/d/msg/gensim/CJZc7KN60JE/9Xs8C0YMgq4J (and Chris' answers there).

HTH,
Radim
Reply all
Reply to author
Forward
0 new messages