运行 Jupyter Notebook on Binder 具有 spacy 依赖

Running Jupter Notebook on Binder with spacy dependencies

我想试试 spacy in a Jupyter Notebook using Binder。当尝试 运行 load 在像这样的模型上时:

nlp = en_core_web_sm.load()

我收到以下错误:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-8a5aa70d40b9> in <module>
----> 1 import en_core_web_sm
      2 nlp = en_core_web_sm.load()

ModuleNotFoundError: No module named 'en_core_web_sm'

我尝试使用 requirements.txt 下载模型,但没有成功,或者模型是在我无权访问的区域下载的。不确定。

这是 Github repo。谢谢。

spaCy 模型未使用 requirements.txt 安装。您必须通过 运行

在您的环境中安装它们
python -m spacy download en_core_web_sm

有关详细信息,请参阅 https://spacy.io/usage/models

您似乎在尝试使用 environment.ymlrequirements.txt。当您的需要需要为 Binderhub 服务的会话移动 requirements.txt 配置文件时,您应该将 requirements.txt 的内容移动到 this example repo 之后的 environment.yml。在您的情况下,尽管您当前的 requirements.txt 行之一与 environment.yml.

中的 spacy 行是多余的(并且冲突)