I'm trying to experiment with NLTK, and I am having trouble using the load() function. I need to try to load a file from my own machine. From what I understand on the internet, I tried this:
import nltk
trailfile = nltk.data.load('C:/quotefilePos.json', 'json', True, True, 'None', 'None', 'None')
After that I got some error messages that look like this:
C:\Python34\python.exe "C:/Users/JarvinLi/PycharmProjects/ThesisTrial1/Trial Loading.py"
<<Loading C://quotefilePos.json>>
Traceback (most recent call last):
File "C:/Users/JarvinLi/PycharmProjects/ThesisTrial1/Trial Loading.py", line 3, in <module>
trailfile = nltk.data.load(r'C:/quotefilePos.json', 'json', True, True, 'None', 'None', 'None')
File "C:\Python34\lib\site-packages\nltk\data.py", line 801, in load
opened_resource = _open(resource_url)
File "C:\Python34\lib\site-packages\nltk\data.py", line 924, in _open
return urlopen(resource_url)
File "C:\Python34\lib\urllib\request.py", line 161, in urlopen
return opener.open(url, data, timeout)
File "C:\Python34\lib\urllib\request.py", line 464, in open
response = self._open(req, data)
File "C:\Python34\lib\urllib\request.py", line 487, in _open
'unknown_open', req)
File "C:\Python34\lib\urllib\request.py", line 442, in _call_chain
result = func(*args)
File "C:\Python34\lib\urllib\request.py", line 1253, in unknown_open
raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: c>
Problem is, I don't understand that it. Any tips, help on how I can get this thing running?
Any reply will be welcomed.
Thanks in advance.