gpt4 book ai didi

linux - Mallet 适用于 Linux 但不适用于 Windows

转载 作者:可可西里 更新时间:2023-11-01 11:30:13 25 4
gpt4 key购买 nike

OK 我正在尝试使用 Mallet 在 Windows 中对一些文档进行分类

我已经在 Linux 中实现了它。只是无法让它在 Windows 中完成工作(目标环境)

我已将数据导入 .mallet 文件。

然后使用此输入数据创建分类器。

-rw-r--r-- 1 henry henry 15197116 Feb 23 15:56 nntp.classifier

07/03/2014  21:28        15,197,116 nntp.classifier

但是当我在 Linux 中运行时:

bin/mallet classify-dir --input ./testfolder --output - --classifier nntp.classifier

它迭代测试文件夹中的所有文件并转储出它认为每个文件的类。

但是如果我在 Windows 中运行相同的命令:

bin\mallet classify-dir --input ./testfolder --output - --classifier nntp.classifier

它只是转储出命令列表:

Mallet 2.0 commands:
import-dir load the contents of a directory into mallet instances (one per file)
import-file load a single file into mallet instances (one per line)
import-svmlight load a single SVMLight format data file into mallet instances (one per line)
train-classifier train a classifier from Mallet data files
train-topics train a topic model from Mallet data files
infer-topics use a trained topic model to infer topics for new documents
estimate-topics estimate the probability of new documents given a trained model
hlda train a topic model using Hierarchical LDA
prune remove features based on frequency or information gain
split divide data into testing, training, and validation portions
Include --help with any option for more information

我注意到的一件事:我

如果我在 Linux 中运行 bin/mallet classify-dir --help 我得到了帮助文件,即每个命令的描述,但在 Windows bin\mallet classify-dir 中也是一样--help 不会产生相同的结果 - 只是上面的命令列表...(如果您输入 junk 作为命令,它会做同样的事情)

而较早的命令之一,例如bin/mallet import-dir --helpbin\mallet import-dir --help 生成相同的完整帮助文件输出。

最佳答案

请注意,ignazio 提供的 .bat 文件的第 23 行有一个拼写错误(不幸的是,它包含在 mallet-2.0.7 下载中)导致它寻找“import-smvlight”而不是“import” -svmlight”,这是帮助信息中指定的内容。如果您想使用此功能,请确保切换“m”和“v”。

关于linux - Mallet 适用于 Linux 但不适用于 Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22261307/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com