带有spacy.load('en_core_web_sm')的ValueError [英] ValueError with spacy.load('en_core_web_sm')
问题描述
我正在
ValueError: could not broadcast input array from shape (96) into shape (128)
为了
spacy.load('en_core_web_sm')
我在有下载限制的工作计算机上工作时,手动下载并安装了模型.
I manually downloaded and installed the model as i'm working on a work computer with download restrictions.
我已按照说明从此链接下载并复制: https://github. com/explosion/spaCy/issues/3113
I have followed the instructions to download and copy from this link: https://github.com/explosion/spaCy/issues/3113
-
复制文件夹
Python35\lib\site-packages\en_core_web_sm
在以下位置创建一个名为en的文件夹Python35\Lib\site-packages\spacy\data
,将复制的内容粘贴到en,然后将文件夹重命名为en_core_web_sm-2.0.0.
Copy the folder
Python35\lib\site-packages\en_core_web_sm
create a folder named en inPython35\Lib\site-packages\spacy\data
, paste the copied contents to en, and rename the folder as en_core_web_sm-2.0.0.
复制
__init__.py
en_core_web_sm中的文件,并将其粘贴到en中(即 init .py文件必须同时位于
Python35\Lib\site-packages\spacy\data\en
和
Python35\Lib\site-packages\spacy\data\en\en_core_web_sm-2.0.0
Copy the
__init__.py
file in en_core_web_sm and paste it in en (that is, the init.py file must be in both
Python35\Lib\site-packages\spacy\data\en
and
Python35\Lib\site-packages\spacy\data\en\en_core_web_sm-2.0.0
我能够跑步
spacy.load('en_core_web_sm')
但是正在提供ValueError.
感谢所有帮助.谢谢!
I am able to run
spacy.load('en_core_web_sm')
but am giving a ValueError instead.
Appreciate all help. Thanks!
推荐答案
我有相同的错误. 将spacy更新到版本2.1.3. 现在它可以正常工作了.
I had the same error. Updated spacy to version 2.1.3. Now it is working properly.
如果您正在使用Anaconda: conda install -c conda-forge spacy
If you are using Anaconda: conda install -c conda-forge spacy
这篇关于带有spacy.load('en_core_web_sm')的ValueError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!