【问题标题】:output-topic-docs gives empty .txt file in Malletoutput-topic-docs 在 Mallet 中给出空的 .txt 文件
【发布时间】:2021-12-18 14:09:36
【问题描述】:

我想在 Mallet 中运行一个模型,并且需要 topic-docs 输出,它为每个主题提供最突出的文档。这对于正确解释不太清楚的主题是必要的。但是 Mallet 一直给我空的 txt 文件。

这是我使用的命令:

    bin\mallet train-topics --input cleandata1000.mallet --num-topics 250 --num-iterations 3000 --optimize-interval 50 --optimize-burn-in 50 --output-topic-keys 1000-300-3000-50-topic-keys.txt --output-topic-docs 1000-300-1000-50-topic-docs.txt --num-top-docs 20 --output-doc-topics 1000-300-1000-50-doc-topics.txt --doc-topics-threshold 0.01 --xml-topic-phrase-report 1000-300-1000-50-topic-phrase.xml --output-state 1000-300-1000-50-state.gz --use-symmetric-alpha true

有人知道是什么原因吗?

编辑以回应 David Mimno 11 月 4 日的评论:

同样的事情发生在不同的数据上(文档的长度不同)。

我刚刚使用 Mallet 的测试数据运行了一些其他模型。特殊之处:该试验根本没有输出(因此“en-topic-docs.txt”没有生成)。

bin\mallet train-topics --input en.mallet --num-topics 5 --output-topic-docs en-topic-docs.txt 

当我要求主题键作为输出时,两个文件都已生成,但 en-topic-docs.txt 为空。

bin\mallet train-topics --input en.mallet --num-topics 5 --output-topic-keys en-topic-keys.txt --output-topic-docs en-topic-docs.txt

我的错:那里一个反复出现的错误消息:

线程“main”java.lang.ClassCastException 中的异常:类 java.net.URI 无法转换为类 java.lang.String(java.net.URI 和 java.lang.String 在模块 java.base 中)加载程序“引导程序”) 在 cc.mallet.topics.ParallelTopicModel.printTopicDocuments(ParallelTopicModel.java:1773) 在 cc.mallet.topics.tui.TopicTrainer.main(TopicTrainer.java:281)

我不知道这可能意味着什么。

感谢您的帮助,您正在挽救我的博士学位 :)

【问题讨论】:

  • 看起来没有什么明显的错误。数据文件是否可能为空或损坏?错误消息会被丢弃吗?

标签: cmd lda topic-modeling mallet


【解决方案1】:

我能够通过使用 github (202108) 上的最新版本而不是 MALLET 2.0.8 来解决此问题。现在它就像一个魅力。

开发版使用说明:http://mallet.cs.umass.edu/download.php

感谢大卫·米诺的指点!

【讨论】:

    猜你喜欢
    • 2012-01-16
    • 2015-03-12
    • 2016-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-01
    • 2012-11-16
    • 1970-01-01
    相关资源
    最近更新 更多