I'm new to python and I need to construct a LDA project. After doing some preprocessing step, here is my code:
dictionary = Dictionary(docs)
corpus = [dictionary.doc2bow(doc) for doc in docs]
from gensim.models import LdaModel
num_topics = 10
chunksize = 2000
passes = 20
iterations = 400
eval_every = None
temp = dictionary[0]
id2word = dictionary.id2token
model = LdaModel(corpus=corpus, id2word=id2word, chunksize=chunksize, \
alpha='auto', eta='auto', \
random_state=42, \
iterations=iterations, num_topics=num_topics, \
passes=passes, eval_every=eval_every)
I want to get a topic distribution of docs, all of the document and get 10 probability of topic distribution, but when I use:
get_document_topics = model.get_document_topics(corpus)
print(get_document_topics)
The output only appear
<gensim.interfaces.TransformedCorpus object at 0x000001DF28708E10>
How do I get a topic distribution of docs?