Python NLTK function: generate () cannot be used
I shouldn't be getting this error. This has worked before and any tutorial revisits this the same way and works. Please help.
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'
print sys.version #my python version 2.7.8 | Anaconda 2.0.1 (x86_64) | (by default, Aug 21, 2014 3:21:46 PM) [GCC 4.2.1 (Apple Inc. build 5577)]
+3
source to share
1 answer
The fourth note in the first online chapter of the NLTK book reads:
The generate () method is not available in NLTK 3.0, but will be restored in the next version
+9
source to share