Thematic output MALLET

I am trying to derive document themes based on my trained MALLET theme model. I use the following command in the mallet directory

./mallet infer-topics --inferencer topic-model --input indata.mallet --output-doc-topics infered_docs

but he was stuck in a personal exception:

java.lang.ClassCastException: cc.mallet.topics.ParallelTopicModel cannot be cast to cc.mallet.topics.TopicInferencer how can I solve this?

+5
source share
1 answer

There is a difference between the model and the pointer. The option --output-model FILENAME in the train-topics command creates a file (model) that contains the training data along with all the output parameters. --inferencer-filename FILENAME creates a much smaller file (infernizer), which contains only the parameters necessary to display themes for new documents.

The infer-topics command needs a pointer object, not a complete model. You can create a pointer from an existing model file by running train-topics with the --input-model FILENAME and --inferencer-filename FILENAME with --num-iterations 0 .

+3
source

Source: https://habr.com/ru/post/1261487/


All Articles