空间es_core_news_sm模型未加载。

问题描述 投票:0回答:1

我想用Spacy来做 pos tagging 在西班牙语中,为此我查阅了官方文档,也阅读了Stackoverflow中的各种帖子,但对我来说都没有用。

我安装了Python 3.7和Spacy 2.2.4,我在jupyter笔记本上运行我的代码。

所以 文件 建议我试一试。

从我的终端机上

python -m spacy download en_core_web_sm

结果是这样的

Download and installation successful

然后在我的jupyter笔记本上:

import spacy
nlp = spacy.load("es_core_news_sm")

我得到了以下的错误。

ValueError: [E173] As of v2.2, the Lemmatizer is initialized with an instance of Lookups containing the lemmatization tables. See the docs for details: https://spacy.io/api/lemmatizer#init

另外,我还试了一下

import spacy

nlp = spacy.load("es_core_news_sm")

这给了我一个不同的错误。

OSError: Can't find model 'es_core_news_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory

你能帮我解决这个错误吗?

python-3.x nlp spacy pos-tagger
1个回答
0
投票

你下载的是英文模型。为了使用西班牙语模型,你必须下载它。python -m spacy download es_core_news_sm

© www.soinside.com 2019 - 2024. All rights reserved.