【发布时间】:2012-04-11 03:49:03
【问题描述】:
我想使用 --use-ngrams true 选项运行槌,但似乎无法使其正常工作。我已使用以下方式导入数据:
./bin/mallet import-dir --input path --output topic-input.mallet --keep-seqence -- removed stopwords
现在我想训练一个主题 ngram 模型:
bin/mallet train-topics --input topic-input.mallet --use-ngrams true --num-topics 30 --xml-topic-report topic-report.xml
但是我收到了这个错误:
Exception in thread "main" java.lang.ClassCastException: cc.mallet.types.FeatureSequence cannot be cast to cc.mallet.types.FeatureSequenceWithBigrams
at cc.mallet.topics.TopicalNGrams.estimate(TopicalNGrams.java:78)
at cc.mallet.topics.tui.Vectors2Topics.main(Vectors2Topics.java:249)
如您所见,我将 mallet 作为命令行工具运行,我宁愿不窥探其 API 以使其正常工作。有什么建议吗?
【问题讨论】:
标签: java mallet lda topic-modeling