how to get word-topic probability using mallet

后端 未结 2 537
独厮守ぢ
独厮守ぢ 2021-01-14 02:10

I\'ve made a parallel topic model using mallet.

And I want to get top-words for each document.

To do that, I\'m trying to get a word-topic probability matrix

2条回答
  •  深忆病人
    2021-01-14 02:59

    Just to make one point regarding the answer of Praveen.

    Using the --word-topic-counts-file, MALLET will create a file which first few rows look something like this:

    0 elizabeth 19:1
    1 needham 19:2 17:1
    2 died 19:2
    3 mother 17:1 19:1 14:1

    where first line means that the word elizabeth has been present in the topic 19 once; second line means that the word needham is associated two times with the topic 19, and with the topic 17 once; and so on...
    Although, this file doesn't give you explicit probabilities, you can use it to calculate them.

提交回复
热议问题