aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.31k stars 337 forks source link

Polyglot Language Models Downloading Error #229

Closed Baher-H closed 4 years ago

Baher-H commented 4 years ago

Hi, I recently installed polyglot on my pycharm 2019.2 and whenever i try to download models _ConnectionResetError occurs. This is what i tried:

transliterator = Transliterator(source_lang="en", target_lang="ru") print(transliterator.transliterate(u"preprocessing"))

And here is what happens:

_Traceback (most recent call last): File "C:/Users/Metro City/PycharmProjects/Most Frequent Words Trial/transliterateAmha.py", line 23, in transliterator = Transliterator(source_lang="en", target_lang="ru") File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\transliteration\base.py", line 28, in init self.decoder = self._decoder() File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\transliteration\base.py", line 38, in _decoder weights = load_transliteration_table(self.target_lang) File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\decorators.py", line 30, in memoizer cache[key] = obj(*args, *kwargs) File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\load.py", line 156, in load_transliteration_table p = locate_resource(src_dir, lang) File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\load.py", line 43, in locate_resource if downloader.status(package_id) != downloader.INSTALLED: File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\downloader.py", line 737, in status info = self._info_or_id(info_or_id) File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\downloader.py", line 507, in _info_or_id return self.info(info_or_id) File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\downloader.py", line 929, in info self._update_index() # If package is not found, most probably we did not File "C:\Users\Metro City\PycharmProjects\untitled3\venv\lib\site-packages\polyglot-16.7.4-py3.7.egg\polyglot\downloader.py", line 831, in _update_index data = urlopen(index_url).read() File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 222, in urlopen return opener.open(url, data, timeout) File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 525, in open response = self._open(req, data) File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 543, in _open '_open', req) File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 503, in _call_chain result = func(args) File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1347, in http_open return self.do_open(http.client.HTTPConnection, req) File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1322, in do_open r = h.getresponse() File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1344, in getresponse response.begin() File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 306, in begin version, status, reason = self._read_status() File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 267, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "C:\Users\Metro City\AppData\Local\Programs\Python\Python37\lib\socket.py", line 589, in readinto return self._sock.recv_into(b) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

Process finished with exit code 1_

Any Solutions