LexPredict / lexpredict-lexnlp

LexNLP by LexPredict
GNU Affero General Public License v3.0
690 stars 175 forks source link

Unable to download from catalog #74

Open Andrew03 opened 1 year ago

Andrew03 commented 1 year ago

Repro steps: Install lexnlp pip install lexnlp Start a python interactive shell and run

from lexnlp.ml.catalog.download import download_github_release

Import fails with error message

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Andrew.Hoang/.local/share/virtualenvs/binary_contract_classification-0V95ndJZ/lib/python3.8/site-packages/lexnlp/ml/catalog/__init__.py", line 20, in <module>
    CATALOG: Path = Path(nltk.data.find('')) / 'lexpredict-lexnlp'
  File "/Users/Andrew.Hoang/.local/share/virtualenvs/binary_contract_classification-0V95ndJZ/lib/python3.8/site-packages/nltk/data.py", line 560, in find
    resource_zipname = resource_name.split("/")[1]
IndexError: list index out of range
Andrew03 commented 1 year ago

Seems to require downloading something from nltk otherwise import does not work.

import nltk
nltk.download()