【问题标题】:how using --use-ngrams in mallet如何在槌中使用--use-ngrams
【发布时间】:2016-11-05 10:47:21
【问题描述】:

我想使用 --use-ngrams true 选项运行 mallet,但似乎无法正常工作。

bin\mallet import-file --input ovary.txt --output ovary2.mallet --keep-sequence-bigrams --remove-stopwords

bin\mallet train-topics --input ovary2.mallet --output-topic-keys ovary_keys2_2.txt --use-ngrams true --num-topics 15

但是我收到了这个错误:

无法识别的选项 4:--use-ngrams

【问题讨论】:

  • 您使用的是哪个版本的木槌?最新版本不支持 n-gram 属性。 n-grams 属性已从最新版本中删除。目前的槌版本在给出输出之前使用内置的 n-gram 功能。所以,要么使用最新版本,要么让我知道你正在使用的版本。

标签: mallet


【解决方案1】:

在 mallet 版本 2.0.8 中,您将使用:

bin\mallet import-file --input ovary.txt --output ovary2.mallet --keep-sequence-bigrams --remove-stopwords   --gram-sizes 1,2

bin\mallet train-topics --input ovary2.mallet --output-topic-keys ovary_keys2_2.txt  --num-topics 15

您可以在以下位置查看可用选项:

bin\mallet import-file  --help

bin\mallet train-topics --help

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-18
    • 1970-01-01
    • 2020-10-18
    • 2014-01-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多