1

When I run the following code using en_code_web_sm

nlp = spacy.load("en_core_web_sm")
doc = nlp("Apple is looking at buying U.K. startup for $1 billion")
for token in doc:
    print(token.text, token.pos_, token.dep_)

but now when I change the language model to en_code_web_lg, I will have the following error:

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.
nlp = spacy.load("en_core_web_lg")
doc = nlp("Apple is looking at buying U.K. startup for $1 billion")
for token in doc:
    print(token.text, token.pos_, token.dep_)
sophros
  • 14,672
  • 11
  • 46
  • 75
  • See https://stackoverflow.com/questions/56470403/spacy-nlp-spacy-loaden-core-web-lg or https://stackoverflow.com/questions/54334304/spacy-cant-find-model-en-core-web-sm-on-windows-10-and-python-3-5-3-anacon – Wiktor Stribiżew Jan 13 '21 at 08:50

1 Answers1

1

Are you sure you downloaded the model 'en_core_web_lg' to disk?

You can do this by running this in the command line:

python -m spacy download en_core_web_lg

or in the script:

import spacy
spacy.cli.download('en_core_web_lg')
sophros
  • 14,672
  • 11
  • 46
  • 75
  • It works when I use the script. I understand why the question 'Are you sure you download the model...'. It took a long while to load the library, and use it to as well for a small sample. – Fong Sow Leong Jan 15 '21 at 07:05