spacy Can't find model 'en_core_web_sm' on windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)

前端 未结 15 1065
傲寒
傲寒 2020-12-08 09:40

what is difference between spacy.load(\'en_core_web_sm\') and spacy.load(\'en\')? This link explains different model sizes. But i am still not clea

15条回答
  •  醉酒成梦
    2020-12-08 10:02

    Steps to load up modules based on different versions of spacy

    download the best-matching version of a specific model for your spaCy installation

    python -m spacy download en_core_web_sm
    pip install .tar.gz archive from path or URL
    pip install /Users/you/en_core_web_sm-2.2.0.tar.gz
    

    or

    pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz
    

    Add to your requirements file or environment yaml file. Theres range of version that one spacy version is comptable with you can view more under https://github.com/explosion/spacy-models/releases

    if your not sure running below code

    nlp = spacy.load('en_core_web_sm') 
    

    will give off a warning telling what version model will be compatible with your installed spacy verion

    enironment.yml example

    name: root
    channels:
      - defaults
      - conda-forge
      - anaconda
    dependencies:
      - python=3.8.3
      - pip
      - spacy=2.3.2
      - scikit-learn=0.23.2
      - pip:
        - https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_sm
    

提交回复
热议问题