b0noI / dialog_converter

MIT License
38 stars 21 forks source link

fix the nltk 'punkt' error #7

Open goswamig opened 6 years ago

goswamig commented 6 years ago

f45c89a20de7:dialog_converter gauta$ python3 converter.py Traceback (most recent call last): File "converter.py", line 10, in SENT_DETECTOR = nltk.data.load('tokenizers/punkt/english.pickle') File "/usr/local/lib/python3.6/site-packages/nltk/data.py", line 836, in load opened_resource = _open(resource_url) File "/usr/local/lib/python3.6/site-packages/nltk/data.py", line 954, in open return find(path, path + ['']).open() File "/usr/local/lib/python3.6/site-packages/nltk/data.py", line 675, in find raise LookupError(resource_not_found) import nltk.data LookupError:


Resource punkt not found. Please use the NLTK Downloader to obtain the resource:

import nltk nltk.download('punkt')

Searched in:

Fix: Just add the below line.

+nltk.download('punkt') + SENT_DETECTOR = nltk.data.load('tokenizers/punkt/english.pickle')

contefranz commented 5 years ago

This indeed solved my problem. Not sure why though it worked

codebrain001 commented 5 years ago

Thanks...helped me too

ghost commented 4 years ago

it worked ....

Chaampz commented 4 years ago

This worked. Thanks

sscswapnil commented 4 years ago

Thanks for the Help

MengshiGeMoncy commented 4 years ago

It works. thanks for the help.

abhi7585 commented 4 years ago

Where to add those lines?

SaloniGandhi commented 4 years ago

!pip install nltk nltk.download('punkt')

paul2048 commented 4 years ago

If you have your VPN on, make sure you turn it off. I turned it off, ran nltk.download('punkt') and then it finally worked.

gentlee66 commented 3 years ago

I wasn't able to download punkt via nltk, so I found this thread on Stack which helped me. https://stackoverflow.com/questions/38916452/nltk-download-ssl-certificate-verify-failed