import nltk.data
tokenizer = nltk.data.load('C:\nltk_data\tokenizers\punkt\english.pickle')
However, the running process failed with the following traceback. I could not figure out the reason. Thank you very much for the help.
Traceback (most recent call last):
File "C:/Users/ugwz/PycharmProjects/project-2/nltk-demo.py", line 4, in <module>
tokenizer = nltk.data.load('C:\nltk_data\tokenizers\punkt\english.pickle')
File "C:\Users\ugwz\AppData\Roaming\Python\Python27\site-packages\nltk\data.py", line 774, in load
opened_resource = _open(resource_url)
File "C:\Users\ugwz\AppData\Roaming\Python\Python27\site-packages\nltk\data.py", line 893, in _open
return urlopen(resource_url)
File "C:\Python27\lib\urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 431, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 454, in _open
'unknown_open', req)
File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1265, in unknown_open
raise URLError('unknown url type: %s' % type)
urllib2.URLError: <urlopen error unknown url type: c>