nlpspacylanguage-modelspacy-3

Spacy Model load error from local directory


I am trying to find a way to load the downloaded en_core_web_lg ==2.3.1 for Spacy == 2.3.2.

Steps:

  1. Downloaded the tar file
  2. extracted it to path

Code:

import spacy
nlp=spacy.load("path/en_core_web_lg")

Error:

OSERROR: [E053] Could not read meta.json from en_core_web_lg/meta.json

Any suggestions will be helpful


Solution

  • The .tar.gz is a python package, not just a model directory, so you probably need to look one level deeper and load en_core_web_lg/en_core_web_lg-2.3.1. You can tell by looking for the directory that contains the subdirectories vocab, tagger, ner, etc.