Untitled1
In [1]:
from nltk.corpus import opinion_lexicon
In [2]:
opinion_lexicon.negative()[:10]
—————————————————————————
LookupError Traceback (most recent call last)
//anaconda/lib/python3.5/site-packages/nltk/corpus/util.py in __load(self)
62 except LookupError as e:
—> 63 try: root = nltk.data.find(‘corpora/%s’ % zip_name)
64 except LookupError: raise e
//anaconda/lib/python3.5/site-packages/nltk/data.py in find(resource_name, paths)
640 resource_not_found = ‘\n%s\n%s\n%s’ % (sep, msg, sep)
–> 641 raise LookupError(resource_not_found)
642
LookupError:
**********************************************************************
Resource ‘corpora/opinion_lexicon.zip/opinion_lexicon/’ not
found. Please use the NLTK Downloader to obtain the resource:
>>> nltk.download()
Searched in:
– ‘/Users/vagrant/nltk_data’
– ‘/usr/share/nltk_data’
– ‘/usr/local/share/nltk_data’
– ‘/usr/lib/nltk_data’
– ‘/usr/local/lib/nltk_data’
**********************************************************************
During handling of the above exception, another exception occurred:
LookupError Traceback (most recent call last)
—-> 1 opinion_lexicon.negative()[:10]
//anaconda/lib/python3.5/site-packages/nltk/corpus/util.py in __getattr__(self, attr)
97 raise AttributeError(“LazyCorpusLoader object has no attribute ‘__bases__'”)
98
—> 99 self.__load()
100 # This looks circular, but its not, since __load() changes our
101 # __class__ to something new:
//anaconda/lib/python3.5/site-packages/nltk/corpus/util.py in __load(self)
62 except LookupError as e:
63 try: root = nltk.data.find(‘corpora/%s’ % zip_name)
—> 64 except LookupError: raise e
65
66 # Load the corpus.
//anaconda/lib/python3.5/site-packages/nltk/corpus/util.py in __load(self)
59 else:
60 try:
—> 61 root = nltk.data.find(‘corpora/%s’ % self.__name)
62 except LookupError as e:
63 try: root = nltk.data.find(‘corpora/%s’ % zip_name)
//anaconda/lib/python3.5/site-packages/nltk/data.py in find(resource_name, paths)
639 sep = ‘*’ * 70
640 resource_not_found = ‘\n%s\n%s\n%s’ % (sep, msg, sep)
–> 641 raise LookupError(resource_not_found)
642
643
LookupError:
**********************************************************************
Resource ‘corpora/opinion_lexicon’ not found. Please use the
NLTK Downloader to obtain the resource: >>> nltk.download()
Searched in:
– ‘/Users/vagrant/nltk_data’
– ‘/usr/share/nltk_data’
– ‘/usr/local/share/nltk_data’
– ‘/usr/lib/nltk_data’
– ‘/usr/local/lib/nltk_data’
**********************************************************************
In [ ]: