windows - Python 3 nltk.data.load error -


i'm trying load english.pickle sentence tokenization. windows 7, python 3.4

file followed path exists(tokenizers/punkt/py3/english.pickle).

here code:

import nltk.data tokenizer = nltk.data.load('tokenizers/punkt/py3/english.pickle')

here error:

oserror: no such file or directory: 'c:\\python\\nltk_data\\tokenizers\\punkt\\py3\\py3\\english.pickle'

how fix?

the problem \\py3 doubled in path. nltk.data.load() method adds /py3 path if called python 3.

so should work if load tokenizer (removing /py3 string):

import nltk tokenizer = nltk.data.load('tokenizers/punkt/english.pickle') 

nltk allow possibility of programs run python 2 , 3.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -