aboSamoor / polyglot

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

Import models manually #94

Open hadifar opened 7 years ago

hadifar commented 7 years ago

Hi, I want to know is it possible to import embedding/transliteration models manually?

shebasarah commented 7 years ago

I tried downloading but gives the following error:

C:\Users\a>polyglot download morph2.en Traceback (most recent call last): File "C:\Users\a\Anaconda3\Scripts\polyglot- script.py", line 11, in load_entry_point('polyglot==16.7.4', 'console_scripts', 'polyglot')() File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 561, in load_entry_point File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 2649, in load_entry_point File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 2303, in load File "C:\Users\a\Anaconda3\lib\site-packages\setuptools-36.0.0-py3.5.egg\pkg_resourcesinit.py", line 2309, in resolve File "C:\Users\a\Anaconda3\lib\site-packages\polyglot-16.7.4-py3.5.egg\polyglotmain.py", line 9, in from signal import signal, SIGPIPE, SIG_DFL ImportError: cannot import name 'SIGPIPE'

Any help is appreciated. Thanks

silveto commented 6 years ago

Hi,

This solved downloader problem on my Win:

In polyglot-16.7.4-py3.5.egg\polyglot\ main .py Comment lines with SIGPIPE

from signal import signal, SIGPIPE, SIG_DFL

signal(SIGPIPE, SIG_DFL)

In polyglot-16.7.4-py3.5.egg\polyglot\downloader.py Find method: def fromcsobj(csobj) and change path.sep to "/"

Then this works on Windows 10 / Python 3.5: polyglot download LANG:pt