nltk - python ntlk donwload gives parser eror -
i trying run following command
import nltk nltk.download('all')
but getting error
traceback (most recent call last): file "./update.py", line 3, in <module> nltk.download('all') file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 664, in download msg in self.incr_download(info_or_id, download_dir, force): file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 534, in incr_download try: info = self._info_or_id(info_or_id) file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 508, in _info_or_id return self.info(info_or_id) file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 875, in info self._update_index() file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 825, in _update_index elementtree.parse(compat.urlopen(self._url)).getroot()) file "/usr/lib/python3.6/xml/etree/elementtree.py", line 1196, in parse tree.parse(source, parser) file "/usr/lib/python3.6/xml/etree/elementtree.py", line 597, in parse self._root = parser._parse_whole(source) xml.etree.elementtree.parseerror: not well-formed (invalid token): line 23, column 143
i new python, not sure should do. looked source module reported above , noticed trying download xml file. ran below command , did not give me error.
compat.urlopen('https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml')
so presume there no issue in download, in parser. can suggest how proceed here?
index.xml
had typo. patched. checked , nltk.download('all')
works fine!
see: nltk/nltk_data#70
Comments
Post a Comment