How to return documents assigned to topics?

Hi, I’m trying LDA tutorial https://pyro.ai/examples/lda.html , how could I return not only topics with assigned words, but also documents passed to a model with assigned discovered topics?

like in gensim it’s just lda_model[corpus[0]] which provides with e.g. [(10, 0.998)] where first document is 99.8% about topic 10
what is the analogous for that in pyro?

The answer to your question is directly in the tutorial you linked. There’s a site with address doc_topics, which gives you the answer that you want, so just grab this site out of your posterior. It’s actually presumably more information than your example above (I haven’t used gensim) because you’ll get a posterior probability vector over all topics, not just the probability that the document is associated with one of them.

1 Like

ah great thank you !!