【问题标题】:NLTK stopwords returns error "LazyCorpusLoader is not callable"NLTK 停用词返回错误“LazyCorpusLoader 不可调用”
【发布时间】:2017-07-08 09:11:23
【问题描述】:

我正在尝试编写一个 python 程序来使用 nltk 包从句子中删除停用词

from nltk.corpus import stopwords
chachedWords = stopwords.words('english')

下面给出TypeError: 'LazyCorpusLoader' object is not callable

【问题讨论】:

    标签: python nltk typeerror stop-words


    【解决方案1】:

    试试:

    from nltk.corpus import stopwords
    import nltk
    nltk.download("stopwords")
    chachedWords = stopwords.words('english')
    

    【讨论】:

    • 谢谢。刚发现导入错误。正在尝试下载。
    猜你喜欢
    • 1970-01-01
    • 2015-10-19
    • 1970-01-01
    • 2019-07-01
    • 2014-05-10
    • 2019-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多