1
votes

I trained a model from a body of text specifying 20 topics, but when I run the inferencer on a new document, it's outputting only 10 topic weights. These are the commands I used:

  1. bin/mallet import-file --input /data/research/bazaarvoice/data/review_nouns.txt --output /data/research/bazaarvoice/data/review_nouns_mallet.mallet --keep-sequence --use-pipe-from /data/research/bazaarvoice/data/ques_mallet.mallet

  2. bin/mallet train-topics \ --input /data/research/bazaarvoice/data/ques_mallet.mallet \ --num-topics 20 \ --output-topic-keys /data/research/bazaarvoice/data/ques_train_keys.txt \

  3. bin/mallet infer-topics \ --input /data/research/bazaarvoice/data/review_nouns_mallet.mallet \ --inferencer-filename /data/research/bazaarvoice/data/ques_train_mallet_topics.txt \ --output-doc-topics /data/research/bazaarvoice/data/review_new_topics.txt

Could you let me know what I'm doing wrong?

1
step 2 also included the output-model command of course, which outputted the file ques_train_mallet_topics.txt (used as the trained model in the inferencer) - Shrabastee Banerjee

1 Answers

1
votes

Add --num-topics 20 to the infer-topics call.