Sign Up

Sign In

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask question.

Unable to load the spacy model ‘en_core_web_lg’ on Google colab

  • 6

I am using spacy in google colab to build an NER model for which I have downloaded the spaCy ‘en_core_web_lg’ model using

    import spacy.cli
    spacy.cli.download("en_core_web_lg")

and I get a message saying

    ✔ Download and installation successful
    You can now load the model via spacy.load('en_core_web_lg')

However then when i try to load the model

    nlp = spacy.load('en_core_web_lg')

the following error is printed:

    OSError: [E050] Can't find model 'en_core_web_lg'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Could anyone help me with this problem?

Share

1 Answer

  1. On colab using a Python 3 kernel, you should be all set with running in one cell (takes a while, but gives you visual feedback about progress, differently from spacy.cli)

    !python -m spacy download en_core_web_lg
    

    Then, restart the colab runtime!

    (to do this in the colab menu, go for Runtime > Restart runtime…).

    After that, executing

    import spacy
    nlp = spacy.load('en_core_web_lg')
    

    should work flawlessly (it still does for me in late 2019).

    • 0
Leave an answer

Leave an answer

Browse

close