2.4.安装spaCy

╰半橙微兮° 2022-11-17 14:35 224阅读 0赞

2.4.安装spaCy

进入Anaconda的prompt命令行界面,执行如下:

  1. (base) C:\Users\toto>pip install spaCy -i https://pypi.tuna.tsinghua.edu.cn/simple
  2. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
  3. Collecting spaCy
  4. Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bb/85/0bfb96f7cca73f1acd44b35ae64ddc236f778307288d2c7e3a760a5fdbfb/spacy-3.0.3-cp38-cp38-win_amd64.whl (11.8 MB)
  5. Collecting preshed<3.1.0,>=3.0.2
  6. Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e3/b1/3b94d70bb1261dffa7fe3aedbf94204a5b24c41fed8c3e71971b4767b039/preshed-3.0.5-cp38-cp38-win_amd64.whl (112 kB)
  7. Collecting spacy-legacy<3.1.0,>=3.0.0
  8. Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  9. c:\users\toto\appdata\local\pip\cache\wheels\32\95\37\0790630b6ab8d0d0c7a34d406cc368159736c164789fe7dd8c\smart_open-3.0.0-py3-none-any.whl
  10. Requirement already satisfied: MarkupSafe>=0.23 in d:\installed\anaconda\lib\site-packages (from jinja2->spaCy) (1.1.1)
  11. Requirement already satisfied: six in d:\installed\anaconda\lib\site-packages (from packaging>=20.0->spaCy) (1.15.0)
  12. Requirement already satisfied: pyparsing>=2.0.2 in d:\installed\anaconda\lib\site-packages (from packaging>=20.0->spaCy) (2.4.7)
  13. Installing collected packages: murmurhash, cymem, preshed, spacy-legacy, catalogue, srsly, typer, pydantic, smart-open, pathy, blis, wasabi, thinc, spaCy
  14. Successfully installed blis-0.7.4 catalogue-2.0.1 cymem-2.0.5 murmurhash-1.0.5 pathy-0.4.0 preshed-3.0.5 pydantic-1.7.3 smart-open-3.0.0 spaCy-3.0.3 spacy-legacy-3.0.1 srsly-2.4.0 thinc-8.0.1 typer-0.3.2 wasabi-0.8.2
  15. (base) C:\Users\toto>

然后执行:

  1. (base) C:\Users\toto>python -m spacy download en

可能会报如下错误:
在这里插入图片描述

解决办法是:
https://blog.csdn.net/hjzgj263446/article/details/103527952

  1. en_core_web_sm-2.2.5:网盘下载(https://pan.baidu.com/s/1D6fc7O9IK0v0jS9j5zqTcw) 提取码:jnmw
  2. en_core_web_md-2.2.5:网盘下载(https://pan.baidu.com/s/1L2H15fHE40w0JXhuoV2HaQ) 提取码:wzq5
  3. de_core_news_sm-2.3.0:网盘下载(https://pan.baidu.com/s/1e4jnbyrkQEPaqrBZDQKKFA) 提取码:3hbz
  4. GitHub上有其他版本对应的下载:https://github.com/explosion/spacy-models/releases
  5. 下载好后
  6. pip install /文件路径/en_core_web_sm-2.2.5.tar.gz

效果图:
在这里插入图片描述

https://github.com/explosion/spacy-models/releases

发表评论

表情:
评论列表 (有 0 条评论,224人围观)

还没有评论,来说两句吧...

相关阅读

    相关 spacy中文句法分析详解

    最近在做中文命名实体识别的研究,因此打算使用spacy来获取句法分析的结构信息,接下里大致说下spacy中所涉及到的一些方法和功能,目前仅仅介绍我使用到的,有不完善的地方请大家