gpt4 book ai didi

python - nltk NgramModel 错误

转载 作者:太空狗 更新时间:2023-10-30 01:00:30 25 4
gpt4 key购买 nike

我之前在nltk中使用过NgramModel类没有报错。但是,我最近将 nltk 更新为 version 3.1我再也找不到 NgramModel 类了。当我尝试像往常一样导入时:

从 nltk.model 导入 NgramModel

我得到了错误

ImportError: 没有名为“nltk.model”的模块

最近是否替换了 NgramModelmodel 模块?

最佳答案

这是一个 open issue因为bugs .

问题中指出:

If you're currently using the version from github, you can switch to the "model" branch, which includes the NgramModel code, though it's currently significantly behind the "develop" branch and hasn't picked up all the newest bug fixes.

模型分支的链接是here .

关于python - nltk NgramModel 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34640116/

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