adobe / NLP-Cube

Natural Language Processing Pipeline - Sentence Splitting, Tokenization, Lemmatization, Part-of-speech Tagging and Dependency Parsing
http://opensource.adobe.com/NLP-Cube/index.html
Apache License 2.0
550 stars 93 forks source link

Error on installing NLP Cube #102

Closed Luiscri closed 5 years ago

Luiscri commented 5 years ago

When I run the pip3 install -U nlpcube command I get the following error:

lineiter = (line.strip() for line in open(filename)) FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4r3qjuhb/nlpcube/

Is it a problem with something I'm doing? I am only trying to install it via pip.

tiberiu44 commented 5 years ago

Can you please try doing a pip3 install nlpcube==1.0.5

Luiscri commented 5 years ago

Output:

Collecting nlpcube==1.0.5
  Could not find a version that satisfies the requirement nlpcube==1.0.5 (from versions: 0.0.9.9, 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6)
No matching distribution found for nlpcube==1.0.5

Should I try installing version 0.1.0.5?

tiberiu44 commented 5 years ago

Yes, please. I confirm that the latest package is broken. I will remove it from pipy.

tiberiu44 commented 5 years ago

I've also uploaded package on pypi. It seems there was an issue with the previous upload. This is the test I just used to validate the package:

$ virtualenv venv
$ source venv/bin/activate
$ pip3 install -U nlpcube
Collecting nlpcube
  Downloading https://files.pythonhosted.org/packages/21/52/abb52487b6b206ecf3122ff12b3a382549f6581fb5c6789d23b823f57a0f/nlpcube-0.1.0.7-py3-none-any.whl (111kB)
     |████████████████████████████████| 112kB 755kB/s
Collecting Cython>=0.28.1 (from nlpcube)
  Downloading https://files.pythonhosted.org/packages/ec/b0/5fb5264fb6277e4591012525800f330377883e7a71d0e1fe812ff96171f4/Cython-0.29.10-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9MB)
     |████████████████████████████████| 2.9MB 22.1MB/s
Collecting flask (from nlpcube)
  Downloading https://files.pythonhosted.org/packages/9a/74/670ae9737d14114753b8c8fdf2e8bd212a05d3b361ab15b44937dfd40985/Flask-1.0.3-py2.py3-none-any.whl (92kB)
     |████████████████████████████████| 92kB 22.0MB/s
Collecting beautifulsoup4 (from nlpcube)
  Using cached https://files.pythonhosted.org/packages/1d/5d/3260694a59df0ec52f8b4883f5d23b130bc237602a1411fa670eae12351e/beautifulsoup4-4.7.1-py3-none-any.whl
Collecting regex (from nlpcube)
  Downloading https://files.pythonhosted.org/packages/86/2a/8dda8b5d603cf379dae79929fb0bb2300ba9debe96f92b30b79b7159aa1b/regex-2019.06.05.tar.gz (651kB)
     |████████████████████████████████| 655kB 44.0MB/s
Collecting future>=0.16.0 (from nlpcube)
Collecting scipy>=1.0.0 (from nlpcube)
  Downloading https://files.pythonhosted.org/packages/04/66/ec5f1283d6a290a9153881a896837487338c44639c1305cc59e1c7b69cc9/scipy-1.3.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (27.7MB)
     |████████████████████████████████| 27.7MB 10.2MB/s
Collecting nose2==0.7.3 (from nlpcube)
Collecting nltk>=3.2.5 (from nlpcube)
  Downloading https://files.pythonhosted.org/packages/73/56/90178929712ce427ebad179f8dc46c8deef4e89d4c853092bee1efd57d05/nltk-3.4.1.zip (3.1MB)
     |████████████████████████████████| 3.1MB 20.7MB/s
Collecting xmltodict==0.11.0 (from nlpcube)
  Using cached https://files.pythonhosted.org/packages/42/a9/7e99652c6bc619d19d58cdd8c47560730eb5825d43a7e25db2e1d776ceb7/xmltodict-0.11.0-py2.py3-none-any.whl
Collecting dyNET (from nlpcube)
  Using cached https://files.pythonhosted.org/packages/d1/e8/80500688b0974c49ff958571a00d1e14e62a0cbfac91820034ea5ca24d2c/dyNET-2.1-cp37-cp37m-macosx_10_7_x86_64.whl
Collecting requests>=2.18.4 (from nlpcube)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
     |████████████████████████████████| 61kB 8.4MB/s
Collecting itsdangerous>=0.24 (from flask->nlpcube)
  Using cached https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting Werkzeug>=0.14 (from flask->nlpcube)
  Downloading https://files.pythonhosted.org/packages/9f/57/92a497e38161ce40606c27a86759c6b92dd34fcdb33f64171ec559257c02/Werkzeug-0.15.4-py2.py3-none-any.whl (327kB)
     |████████████████████████████████| 327kB 8.9MB/s
Collecting Jinja2>=2.10 (from flask->nlpcube)
  Downloading https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
     |████████████████████████████████| 133kB 23.1MB/s
Collecting click>=5.1 (from flask->nlpcube)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting soupsieve>=1.2 (from beautifulsoup4->nlpcube)
  Downloading https://files.pythonhosted.org/packages/b9/a5/7ea40d0f8676bde6e464a6435a48bc5db09b1a8f4f06d41dd997b8f3c616/soupsieve-1.9.1-py2.py3-none-any.whl
Collecting numpy>=1.13.3 (from scipy>=1.0.0->nlpcube)
  Downloading https://files.pythonhosted.org/packages/6b/be/608b7f72b851472388eafc010a5d46dae5d41610d0ac5df4c98c2ed1b865/numpy-1.16.4-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (13.9MB)
     |████████████████████████████████| 13.9MB 7.6MB/s
Collecting six>=1.7 (from nose2==0.7.3->nlpcube)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting coverage>=4.4.1 (from nose2==0.7.3->nlpcube)
  Using cached https://files.pythonhosted.org/packages/a8/39/5334b42cc81a40d50901eca26f4fac4480b44ac318db55d2b621d0aaca09/coverage-4.5.3-cp37-cp37m-macosx_10_13_x86_64.whl
Collecting idna<2.9,>=2.5 (from requests>=2.18.4->nlpcube)
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.18.4->nlpcube)
  Using cached https://files.pythonhosted.org/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.18.4->nlpcube)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests>=2.18.4->nlpcube)
  Downloading https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl (150kB)
     |████████████████████████████████| 153kB 23.7MB/s
Collecting MarkupSafe>=0.23 (from Jinja2>=2.10->flask->nlpcube)
  Using cached https://files.pythonhosted.org/packages/ce/c6/f000f1af136ef74e4a95e33785921c73595c5390403f102e9b231b065b7a/MarkupSafe-1.1.1-cp37-cp37m-macosx_10_6_intel.whl
Building wheels for collected packages: regex, nltk
  Building wheel for regex (setup.py) ... done
  Stored in directory: /Users/tiberiuboros/Library/Caches/pip/wheels/49/35/7c/7faf4dc02cdad88d0388e0f895621a34479e1f17f9e4f4ee12
  Building wheel for nltk (setup.py) ... done
  Stored in directory: /Users/tiberiuboros/Library/Caches/pip/wheels/97/8a/10/d646015f33c525688e91986c4544c68019b19a473cb33d3b55
Successfully built regex nltk
Installing collected packages: Cython, itsdangerous, Werkzeug, MarkupSafe, Jinja2, click, flask, soupsieve, beautifulsoup4, regex, future, numpy, scipy, six, coverage, nose2, nltk, xmltodict, dyNET, idna, certifi, chardet, urllib3, requests, nlpcube
Successfully installed Cython-0.29.10 Jinja2-2.10.1 MarkupSafe-1.1.1 Werkzeug-0.15.4 beautifulsoup4-4.7.1 certifi-2019.3.9 chardet-3.0.4 click-7.0 coverage-4.5.3 dyNET-2.1 flask-1.0.3 future-0.17.1 idna-2.8 itsdangerous-1.1.0 nlpcube-0.1.0.7 nltk-3.4.1 nose2-0.7.3 numpy-1.16.4 regex-2019.6.5 requests-2.22.0 scipy-1.3.0 six-1.12.0 soupsieve-1.9.1 urllib3-1.25.3 xmltodict-0.11.0

And the test:

$ ipython3
/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py:915: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
  warn("Attempting to work in a virtualenv. If you encounter problems, please "
Python 3.7.3 (default, Mar 27 2019, 09:23:15)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.0.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from cube.api import Cube
   ...:
   ...: cube=Cube(verbose=True)
In [2]: cube.load("en")
Latest version found online: en-1.1
Download complete, decompressing files ...
Model extracted successfully.
Checking for associated vector embeddings file [wiki.dummy.vec] ...
Embeddings downloaded successfully.                                                downloading 0.00/0.00 MB ...
    Loading embeddings ...
    Loading tokenization model ...
    Loading lemmatization model ...
    Loading tagger model ...
    Loading parser model ...
Model loading complete.

In [3]: text="All the faith he had had, had had no effect on the outcome of his life."
   ...:
   ...: sentences=cube(text)
   ...:
   ...: for sentence in sentences:
   ...:   for entry in sentence:
   ...:     print(str(entry.index)+"\t"+entry.word+"\t"+entry.lemma+"\t"+entry.upos+"\t"+entry.xpos+"\t"+entry.attrs+"\t"+str(entry.head)+"\t"+str(entry.label)+"\t"+entry.space_after)
   ...:   print("")
1   All all DET PDT _   3   det:predet  _
2   the the DET DT  Definite=Def|PronType=Art   3   det _
3   faith   faith   NOUN    NN  Number=Sing 9   nsubj   _
4   he  he  PRON    PRP Case=Nom|Gender=Masc|Number=Sing|Person=3|PronType=Prs  6   nsubj   _
5   had have    AUX VBD Mood=Ind|Tense=Past|VerbForm=Fin    6   aux _
6   had have    VERB    VBN Tense=Past|VerbForm=Part    3   acl:relcl   SpaceAfter=No
7   ,   ,   PUNCT   ,   _   9   punct   _
8   had have    AUX VBD Mood=Ind|Tense=Past|VerbForm=Fin    9   aux _
9   had have    VERB    VBN Tense=Past|VerbForm=Part    0   root    _
10  no  no  DET DT  _   11  det _
11  effect  effect  NOUN    NN  Number=Sing 9   obj _
12  on  on  ADP IN  _   14  case    _
13  the the DET DT  Definite=Def|PronType=Art   14  det _
14  outcome outcome NOUN    NN  Number=Sing 11  nmod    _
15  of  of  ADP IN  _   17  case    _
16  his he  PRON    PRP$    Gender=Masc|Number=Sing|Person=3|Poss=Yes|PronType=Prs  17  nmod:poss   _
17  life    life    NOUN    NN  Number=Sing 14  nmod    SpaceAfter=No
18  .   .   PUNCT   .   _   9   punct   SpaceAfter=No

Thanks for letting us know about this issue.

KoichiYasuoka commented 5 years ago

Thank you for the new release including ConllEntry issue #93. Now "".join("".join(str(entry)+"\n" for entry in sentence)+"\n" for sentence in sentences) work well with 0.1.0.7.

tiberiu44 commented 5 years ago

@KoichiYasuoka , thank you for that PR again. @Luiscri, I hope everything works for you now.

All our tests passed, so I'm closing this bug.