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
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.
When you are building topics using MALLET, you have an option called --word-topic-counts-file
. When you give this option and specify a file, MALLET writes ( topic, word, probability ) values per each line in the file. You can later read this file in C, Java or R (of course, any language) to create the matrix you want.