AttributeError:'module'对象没有带有nltk.LogicParser()的属性'LogicParser'(AttributeError:

编程入门 行业动态 更新时间:2024-10-27 23:18:54
AttributeError:'module'对象没有带有nltk.LogicParser()的属性'LogicParser'(AttributeError: 'module' object has no attribute 'LogicParser' with nltk.LogicParser())

我正在玩自然语言处理与Python的例子和这一行:

lp = nltk.LogicParser()

产生

AttributeError: 'module' object has no attribute 'LogicParser'

错误信息。 我导入了几个nltk模块,我无法弄清楚缺少什么。 有什么线索吗?

I'm playing with examples from Natural Language Processing with Python and this line:

lp = nltk.LogicParser()

produces

AttributeError: 'module' object has no attribute 'LogicParser'

error message. I imported several nltk modules and I can't figure out what is missing. Any clues?

最满意答案

听起来你已经发现了这个问题,但以防万一:你正在阅读第一版的NLTK书籍,但显然你已经安装了NLTK 3,它有很多变化。 请查看第10章的当前版本以了解正确用法。

It sounds like you've spotted the problem, but just in case: You are reading the first edition of the NLTK book, but evidently you have installed NLTK 3, which has many changes. Look at the current version of chapter 10 for the correct usage.

更多推荐

本文发布于:2023-08-06 13:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1448606.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   对象   AttributeError   module   nltk

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!