0

我正在尝试运行 Mallet 的主题建模,但出现以下错误:

Couldn't open cc.mallet.util.MalletLogger resources/logging.properties file.
Perhaps the 'resources' directories weren't copied into the 'class' directory.
Continuing.
Exception in thread "main" java.lang.IllegalArgumentException: Trouble reading file     stoplists\en.txt at    cc.mallet.pipe.TokenSequenceRemoveStopwords.fileToStringArray(TokenSequenceRemoveStopwords.java:144) at cc.mallet.pipe.TokenSequenceRemoveStopwords.<init>(TokenSequenceRemoveStopwords.java:73) at LDA.TopicModel.main(TopicModel.java:23)  

我已经添加了所有的jar文件!你能告诉我这里有什么问题吗?

谢谢,

4

2 回答 2

1

我收到了第一个错误,它也可以继续。

但是阻止您的实际例外似乎是您没有在正确的位置放置 MALLET 停用词列表。我将他们的 en.txt 停用词列表下载到特定位置,并为其提供了直接路径,而不是“stoplists/en.txt”,这很有效。

于 2014-11-14T20:07:42.030 回答
0

您的英文停用词文件丢失 (stoplists\en.txt)。要么尝试再次下载 jar 文件,要么只使用 maven,这将使您更容易导入您的 java 项目。在 Maven POM 文件中添加:

<dependencies>
    <dependency>
        <groupId>cc.mallet</groupId>
        <artifactId>mallet</artifactId>
        <version>2.0.8</version>
    </dependency>
....
</dependencies>

最新版本可以在这里找到。

于 2017-09-18T18:53:55.823 回答