1.取出一个新闻列表页的全部新闻 包装成函数。 2.获取总的新闻篇数,算出新闻总页数。 3.获取全部新闻列表页的全部新闻详情。 4.找一个自己感兴趣的主题,进行数据爬取,并进行分词分析。不能与其它同学雷同。 结果截图: ...
分类:
其他好文 时间:
2018-04-11 21:42:52
阅读次数:
192
代码在github网站,https://github.com/chaigee/chaigee,中的z2.py文件 py.txt为团队中文简介文件 代码运行后词频统计使用xlwt库将数据发送到excel表格,如图,频数为1的省略 在excel表格作柱形图如图所示 由此分析我们团队的简介用词得出:我们团 ...
分类:
其他好文 时间:
2018-04-11 00:09:35
阅读次数:
226
中文分词工具jieba的使用 1.进入到安装了全文检索工具包的虚拟环境中 /home/python/.virtualenvs/py3_django/lib/python3.5/site-packages/ 进入到haystack/backends/中 2.创建ChineseAnalyzer.py文件 ...
分类:
其他好文 时间:
2018-04-03 23:56:32
阅读次数:
206
下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 ...
分类:
其他好文 时间:
2018-03-29 00:05:39
阅读次数:
142
下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 ...
分类:
其他好文 时间:
2018-03-28 18:54:09
阅读次数:
126
下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 ...
分类:
其他好文 时间:
2018-03-28 18:51:12
阅读次数:
127
下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 ...
分类:
其他好文 时间:
2018-03-28 18:50:47
阅读次数:
158
import jieba fo=open('aaa.txt','r',encoding = 'utf-8') text=fo.read() text2=list(jieba.lcut(text)) sign={'你',' ','我','我们', '他', '他们', '我的', '他的', '你的' ...
分类:
其他好文 时间:
2018-03-28 16:52:22
阅读次数:
137
import jieba news = open('bignews.txt','r').read() news_cut = jieba.lcut(news) dict = {} for i in set(news_cut): dict[i]=news_cut.count(i) delete={'的' ...
分类:
其他好文 时间:
2018-03-28 16:47:42
阅读次数:
133
下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 ...
分类:
其他好文 时间:
2018-03-28 16:44:54
阅读次数:
123