python - python在尝试加载spacy时抛出一些错误
问题描述
import pandas as pd
from ast import literal_eval
from nltk.corpus import stopwords
import string
stops = stopwords.words('english')
stops.extend(['none'])
import nltk
import re
import numpy as np
from pprint import pprint
import gensim
import gensim.corpora as corpora
from gensim.utils import simple_preprocess # for tokenizing
from gensim.models import CoherenceModel
from sklearn.feature_extraction import stop_words
import spacy
错误是:
来自 sklearn.feature_extraction 的 20 中的 AttributeError Traceback (最近一次调用最后一次) 导入 stop_words 21 ---> 22 import spacy 23 24 import pyLDAvis
~\AppData\Local\Continuum\anaconda3\lib\site-packages\spacy__init__.py in 10 from thinc.neural.util import prefer_gpu, require_gpu 11 ---> 12 from . 从 .cli.info 导入管道 13 导入信息作为 cli_info 14 从 .glossary 导入说明
~\AppData\Local\Continuum\anaconda3\lib\site-packages\spacy\pipeline__init__.py in 2 from __future__ import unicode_literals 3 ----> 4 from .pipes import Tagger, DependencyParser, EntityRecognizer, EntityLinker 5 from .pipes import TextCategorizer、Tensorizer、Pipe、Sentencizer 6 from .morphologizer 导入 Morphologizer
初始化 spacy.pipeline.pipes() 中的管道.pyx
~\AppData\Local\Continuum\anaconda3\lib\site-packages\spacy\syntax\nn_parser.cp37-win_amd64.pyd init spacy.syntax.nn_parser()
AttributeError:类型对象“spacy.syntax.nn_parser.array”没有属性“__reduce_cython__”
解决方案
推荐阅读
- javascript - 当 useState() 改变时如何渲染 React 功能组件?
- javascript - react函数组件中重渲染的逻辑
- swiftui - 在 SwiftUI 中的 didSet 情况下面对 State 或 Binding 的一些奇怪行为
- python - Pandas 数据框重复行与类中的列表分隔?
- jquery - 根据切换按钮状态使用 ajax 每 5 秒刷新一次表数据
- php - 如何使“ReflectionException:Class ...”错误通过 PHPUnit 5.7
- swiftui - 构建一个显示照片之类的照片应用程序(缩放和平移)的页面
- java - JAVA/选择排序:控制台显示的结果与我输入的不同
- postgresql - 两个表之间的 PostgreSQL 滞后函数
- css - 如何将此 WooCommerce 购物车图标更改为文本