我已引用链接 I get an error message when I try FreqDist() in NLTK -- NameError: name 'nltk' is not defined 但是,我仍然收到以下错误。
最佳答案
需要先导入nltk才能使用nltk.ConditionalFreqDist
>>> import nltk
>>> nltk.ConditionalFreqDist()
<ConditionalFreqDist with 0 conditions>
或者使用命名空间,
>>> from nltk import ConditionalFreqDist
>>> ConditionalFreqDist()
<ConditionalFreqDist with 0 conditions>
关于nltk - 当我在 NLTK 中尝试 FreqDist() 时收到错误消息 — NameError : name 'nltk' is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24760820/