I have averaged_perceptron_tagger loaded here:
\\domain\Anaconda\envs\nlp\Lib\nltk_data\taggers\averaged_perceptron_tagger\averaged_perceptron_tagger.pickle
I am attempting to retrieve this tagger like this:
tagger = PerceptronTagger()
This results in this error:
Traceback (most recent call last):
File "<ipython-input-18-58b392c276d2>", line 1, in <module>
tagger = PerceptronTagger()
File "\\domain\Anaconda\envs\nlp\lib\site-packages\nltk\tag\perceptron.py", line 170, in __init__
self.load(AP_MODEL_LOC)
File "\\domain\Anaconda\envs\nlp\lib\site-packages\nltk\tag\perceptron.py", line 253, in load
self.model.weights, self.tagdict, self.classes = load(loc)
File "\\domain\Anaconda\envs\nlp\lib\site-packages\nltk\data.py", line 752, in load
opened_resource = _open(resource_url)
File "\\domain\Anaconda\envs\nlp\lib\site-packages\nltk\data.py", line 880, in _open
return find(path_, [""]).open()
File "\\domain\Anaconda\envs\nlp\lib\site-packages\nltk\data.py", line 585, in find
raise LookupError(resource_not_found)
LookupError:
**********************************************************************
Resource C: not found.
Please use the NLTK Downloader to obtain the resource:
import nltk
nltk.download('C:')
For more information see: https://www.nltk.org/data.html
Attempted to load /C:/Users/username/domain/Anaconda/envs/nlp/lib/nltk_data/taggers/averaged_perceptron_tagger/averaged_perceptron_tagger.pickle
Searched in:
- ''
**********************************************************************
Why is nltk mashing two paths together (C:/Users/username & the full domain path where the tagger actually exists?
I tried calling the path directly like this...
tagger = nltk.data.load(r'\\domain\Anaconda\envs\nlp\Lib\nltk_data\taggers\averaged_perceptron_tagger\averaged_perceptron_tagger.pickle')
...which resulted in the same error.