利用jieba的一条语句提炼2016政府工作报告中的权重词语

来源:互联网 发布:移动群发短信软件 编辑:程序博客网 时间:2024/04/30 23:10

python jieba 模块的GitHub主页:https://github.com/fxsjy/jieba

# encoding=utf-8import jiebaimport jieba.analysefilename='2016.txt'content = open(filename,'rb').read()tags = jieba.analyse.extract_tags(content,topK=10,withWeight=True, allowPOS=())for tag in tags:    print ("tag: %s\t\t weight: %f" % (tag[0],tag[1]))

运行后得到的结果:
这里写图片描述

0 0
原创粉丝点击