denpy
denpy

Reputation: 279

How to resolve Spacy POS Attribute E1005 Error

I was able to install spaCy and download the standard English model (en_core_web_sm).

But by just loading the standard data model, I received the following error message:

import spacy
​
# Load English tokenizer, tagger, parser and NER
nlp = spacy.load("en_core_web_sm")


ValueError: [E1005] Unable to set attribute 'POS' in tokenizer exception for '  '. 
Tokenizer exceptions are only allowed to specify ORTH and NORM.

I check the Config.CFG but don't see any POS attribute. Any help is greatly appreciated as I searched the Internet for an answer....

PS, using pip freeze, here are some of the libraries

spacy==3.0.6
spacy-legacy==3.0.5
en-core-web-sm==2.2.0

Upvotes: 2

Views: 1415

Answers (1)

polm23
polm23

Reputation: 15623

You have a model for spaCy v2 (the model version starts with 2), but you are using spaCy v3. The models are not compatible with different major versions. You need to uninstall the model and then download the new model:

pip uninstall en-core-web-sm
pip -m spacy download en_core_web_sm

Upvotes: 2

Related Questions