dialog_converter
dialog_converter copied to clipboard
fix the nltk 'punkt' error
f45c89a20de7:dialog_converter gauta$ python3 converter.py
Traceback (most recent call last):
File "converter.py", line 10, in
Resource punkt not found. Please use the NLTK Downloader to obtain the resource:
import nltk nltk.download('punkt')
Searched in: - '/Users/gauta/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share/nltk_data' - '/usr/lib/nltk_data' - '/usr/local/lib/nltk_data' - '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/nltk_data' - '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/share/nltk_data' - '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/nltk_data' - ''
Fix: Just add the below line.
+nltk.download('punkt') + SENT_DETECTOR = nltk.data.load('tokenizers/punkt/english.pickle')