gpt4 book ai didi

Python NLTK : generate() function cannot be used

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

我不应该得到这个错误。这以前有效,任何教程都以相同的方式复习此方法并且有效。请帮忙。

import nltk 
from nltk.book import *

text3.generate()

AttributeError                            Traceback (most recent call last)
<ipython-input-2-e0816ba18b61> in <module>()
----> 1 text3.generate()

AttributeError: 'Text' object has no attribute 'generate'

打印 sys.version #我的 python 版本2.7.8 | python 2.0.1 (x86_64)| (默认,2014 年 8 月 21 日,15:21:46)[GCC 4.2.1(苹果公司内部版本 5577)]

最佳答案

first online chapter of the NLTK 中的第四个音符书上说:

The generate() method is not available in NLTK 3.0 but will be reinstated in a subsequent version

关于Python NLTK : generate() function cannot be used,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27537023/

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