![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
NLP
柯努力
这个作者很懒,什么都没留下…
展开
-
python 计算idf 自定义逆向文件频率IDF
python3 jieba分词 代码如下: import jieba import jieba.analyse import math import pandas as pd import os #获取停用词 stopwords_path = 'data/stopword.txt' stopwords_list = [line.strip() for line in open(stopwords_path,'r',encoding='utf-8').readlines() ] # 获取数据 d原创 2021-09-01 14:39:35 · 387 阅读 · 0 评论 -
python gensim AttributeError: ‘Doc2Vec‘ object has no attribute ‘dv‘
python3 gensim 4.0.1 我的代码:Doc2Vec加载doc2vec模型文件的时候报错了 from gensim.models import Doc2Vec doc2vec_model = Doc2Vec.load('data/doc2vec.model') “AttributeError: 'Doc2Vec' object has no attribute 'dv'” 解决方法: 可能是最新版本的一些问题,换版本!!! 我把gensim卸载了 pip uninstal.原创 2021-08-27 17:41:24 · 3069 阅读 · 1 评论 -
python: 哈工大pyltp分词工具安装
环境:linux, python3.6 安装方式1:pip install pyltp 若报错: error: command 'gcc' failed with exit status 1 解决办法: yum install gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64 yum -y install gcc yum -...原创 2020-04-07 15:44:28 · 593 阅读 · 0 评论 -
NLP基础一:python 中文分词
jieba 哈工大LTP hanlp pkuseg 分词工具一:jieba import jieba # 分词 cut_list = jieba.cut("我是来自韩山师范学院,数学与统计学院的一名学生", cut_all=True) print("全模式: " + ",".join(cut_list)) cut_list = jieba.cut("我...原创 2019-09-17 22:49:26 · 248 阅读 · 0 评论 -
NLP基础二:python 词性标注
一、jieba词性标注 """ 词性标注 """ import jieba.posseg as pseg result = pseg.cut("我是来自韩山师范学院,数学与统计学院的一名学生") for w in result: print(w.word,"/", w.flag, ",", end=' ') 打印输出: 我/r 是/v 来自/v 韩山/ns 师范学院/n ,/x 数学/n...原创 2019-09-17 22:52:04 · 561 阅读 · 0 评论