Search code examples
pythonnlpspacy

error "Unable to load vocabulary from file" when loading spacy "fr_dep_news_trf" model


I can't load the fr_dep_news_trf model with spacy.

nlp = spacy.load('fr_dep_news_trf')

It raises a "Unable to load vocabulary from file" error.

The model has been installed with the command

python -m spacy download fr_dep_news_trf

and install was successful

Version info : spaCy version : 3.0.6 / Python version 3.7.8 / Pipelines fr_dep_news_trf (3.0.0)


Solution

  • The model download or install is probably corrupted. Uninstall the model package (pip uninstall fr_dep_news_trf) and try downloading it again without using any local cached copies (spacy download fr_dep_news_trf --no-cache-dir)