我正在做一个 nlp 项目并想使用 spacy。但是当尝试为 nlp 对象加载语言时,我一直遇到错误:
AttributeError: type object 'spacy.syntax.nn_parser.array' has no attribute '__reduce_cython__'
Run Code Online (Sandbox Code Playgroud)
代码:
test = nlp('many people like laughing while they are running')
for word in test:
print(word.text,word.lemma)
Run Code Online (Sandbox Code Playgroud)
我不确定,但问题可能与我正在使用的虚拟环境有关。我发现的一种解决方案建议“将 spaCy 路径添加到 virtualenv 中的 PYTHONPATH”
所以我的实际 2 个问题是:1)你认为我的问题在哪里?2)如果您认为问题与虚拟环境有关,如何在virtualenv中将spaCy路径添加到PYTHONPATH?
预先感谢您的帮助
我是初学者,所以我不太了解堆栈溢出、venvs 以及了解我的问题所需的信息。这是我能给你的:
我正在关注本教程:https : //github.com/bhargavvader/personal/tree/master/notebooks/text_analysis_tutorial
Operating System: Linux Mint 19.1 Cinnamon
Python Version Used: Python 3.7.1
spaCy Version Used: 2.1.3
Run Code Online (Sandbox Code Playgroud)
我正在通过 anaconda 使用 python
到目前为止我所做的: 当然我在互联网上搜索了错误这是我的错误日志:
我如何理解这是错误日志中发生错误的部分?:
----> 4 from .pipes import Tagger, …