NLP代码实现
侠客儿青争ing
这个作者很懒,什么都没留下…
展开
-
win10解决tensorflow2.0命令行导入成功,pycharm导入失败问题
会出现这样的原因是 pycharm没有配置好环境 未使用下载了tf的环境解释器 我是在anaconda新建子环境 tf2 因此要导入conda解释器 操作如下 成功解决原创 2020-08-14 09:40:21 · 560 阅读 · 0 评论 -
文本分类ML
import pandas as pd import os os.chdir(r'C:\Users\lujing\Desktop\NLP两周实践') train=pd.read_csv('train_set.csv',sep='\t') train.shape (200000, 2) train.head(10) label text 0 2 2967 6758 339 202原创 2020-07-24 22:26:49 · 776 阅读 · 0 评论 -
NLP_代码表示文本向量
第一种表示方式 Count 次数 from sklearn.feature_extraction.text import CountVectorizer corpus = [ 'This is the first document . ', 'this document is the second document.', 'the last one' ] vectorizer = CountVectorizer() vectorizer.fit_transform(corpus)原创 2020-07-23 15:12:23 · 245 阅读 · 0 评论