Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling for SpacyPreprocessor without model #1458

Open
bhancock8 opened this issue Sep 11, 2019 · 3 comments
Open

Improve error handling for SpacyPreprocessor without model #1458

bhancock8 opened this issue Sep 11, 2019 · 3 comments
Assignees
Labels
feature request help wanted no-stale Auto-stale bot skips this issue

Comments

@bhancock8
Copy link
Member

Is your feature request related to a problem? Please describe.

The first time a user tries to use the SpacyPreprocessor, they hit they following error:

  File "<stdin>", line 1, in <module>
  File "/Users/braden/anaconda3/lib/python3.7/site-packages/spacy/__init__.py", line 27, in load
    return util.load_model(name, **overrides)
  File "/Users/braden/anaconda3/lib/python3.7/site-packages/spacy/util.py", line 139, in load_model
    raise IOError(Errors.E050.format(name=name))
OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Describe the solution you'd like

We know the line where the spacy model is called (

self._nlp = spacy.load(language, disable=disable or [])
) and should be able to catch that Exception and download it if its missing.

@henryre
Copy link
Member

henryre commented Sep 11, 2019

Agreed! Let's just raise a more informative error rather than downloading something possibly unexpected.

@rjurney
Copy link

rjurney commented Oct 18, 2019

@henryre @bhancock8 I have a related problem instantiating SpacyPreprocessor here: #1496

@rjurney
Copy link

rjurney commented Oct 19, 2019

I’m going to fix this over the weekend.

@vincentschen vincentschen added the no-stale Auto-stale bot skips this issue label Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request help wanted no-stale Auto-stale bot skips this issue
Projects
None yet
Development

No branches or pull requests

5 participants