Python利用jieba获取中文词汇等

import jieba
import os
import jieba.analyse data = cleaned_comments # 数据来源于评论数据
seg = jieba.lcut(data)
print(seg) # 增加自定义词表库
mydict = os.getcwd()+"/mydict.txt"
jieba.load_userdict(mydict)
seg = jieba.lcut(data)
print(seg) import jieba.posseg as pseg
posseg = pseg.lcut(data)
print(posseg) # 抽取出现次数最多的词汇
extracttext = jieba.analyse.extract_tags(data, topK=20,withWeight=False, allowPOS=())
print(extracttext)

待续。。。

上一篇:采用二进制方式安装K8S集群,版本etcd-v3.3.10,flannel-v0.11.0,kubernetes-server-linux-amd64


下一篇:EF Core 相关的千倍性能之差: AutoMapper ProjectTo VS Mapster ProjectToType