how to get a probability distribution for a topic

2020-05-01 01:51发布

问题:

Using mallet I can get a specific number of topics and their words. How can I make sure topic words make a probability distribution (ie sum to one)?

For example if I run it as bellow, how can I use the outputs given by mallet to make sure probabilities of topic words for topic 0 adds up to 1?

mallet train-topics --input text.vectors --output-topic-keys topics.txt --output-doc-topics doc_comp.txt --topic-word-weights-file weights.txt --num-top-words 50 --word-topic-counts-file counts.txt --num-topics 3 --output-state topicstate.gz --alpha 1