pythonnlpspacyhuggingface-transformersspacy-transformers

Bertbaseuncased install with spacy is not working


I am trying to start an NLP project using spacy transformers. When trying to install bertbaseuncased I'm getting this error:

✘ No compatible package found for 'en_trf_bertbaseuncased_lg' (spaCy
v3.6.0)

I've been researching for quite some time and haven't found anything to solve my issue. Here is what I'm running in the command line:

> pip install spacy-transformers
> python -m spacy download en_trf_bertbaseuncased_lg

as per https://explosion.ai/blog/spacy-transformers

the spacy-transformers installation works just fine. I also tried different packages and they gave me similar errors.


Solution

  • This is addressed in a discussion on the Spacy github repo.

    The explanation of the error is that en_trf_bertbaseuncased_lg is a Spacy 2.x model and you are using 3.x.

    Instead of said model, you can download and use en_core_web_trf, which contains transformer models for Spacy 3.x:

    pip install -U spacy
    python -m spacy download en_core_web_trf