首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ImportError:无法从“sklearn.feature_extraction.text”导入名称“countVectorizer”

ImportError:无法从“sklearn.feature_extraction.text”导入名称“countVectorizer”
EN

Stack Overflow用户
提问于 2020-05-02 17:53:12
回答 1查看 3.6K关注 0票数 2

代码语言:javascript
复制
import numpy as np
from sklearn.feature_extraction.text import countVectorizer
count=countVectorizer
docs=np.array(['The sun is shinning',
               'The weather is sweet',
               'The sun is shinning,The weather is sweet, and one and one is two'])
bag= count.fit_transform(docs)

误差输出

代码语言:javascript
复制
ImportError                               Traceback (most recent call last)
<ipython-input-1-e322748c3b4c> in <module>
      1 import numpy as np
----> 2 from sklearn.feature_extraction.text import countVectorizer
      3 count=countVectorizer
      4 docs=np.array(['The sun is shinning',
      5                'The weather is sweet',

ImportError: cannot import name 'countVectorizer' from 'sklearn.feature_extraction.text' (C:\ProgramData\Anaconda3\lib\site-packages\sklearn\feature_extraction\text.py)

语句我得到了这个错误,帮助我解决它,我在anaconda导航提示中使用jupyter笔记本,我安装了最新版本的scikit-,但我也收到了相同的导入错误。然后还安装和卸载了scikit学习使用Anaconda命令提示符。

EN

回答 1

Stack Overflow用户

发布于 2020-11-02 09:38:30

从sklearn.feature_extraction.text导入CountVectorizer

正在工作

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61563894

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档