dongwookim-ml / python-topic-model

Implementation of various topic models
Apache License 2.0
369 stars 172 forks source link

Author-topic LDA #9

Closed shihui2010 closed 7 years ago

shihui2010 commented 7 years ago

Hi,

For author-topic model, could you please provide an example of showing topic of docs after model being trained? I find only ways to show topic distribution of author and word distribution of topic, however, in my case, I care topic of docs much more.

Thanks.

dongwookim-ml commented 7 years ago

In theory, it is not possible to infer the topic distribution of documents, since the AT model does not have any assumptions on that. If you'd like to get some estimate of topic distribution, one possible alternative is to aggregate a topic assignment of word token in a document. For example, model.topic_assigned[0] will give you the assigned topic for each word token in document 0. Counting and normalising these assignments will give you some empirical estimate of topic distribution.