项目:基于中文新闻分词绘制词云图
一、项目关键实现:jieba中文分词、分词结果统计、词云图展示、前端树形结构展示
二、项目关键技术:jsp,servlet,mvc模式,ajax,echarts,mysql数据库,jieba分词,python。
三、项目关键步骤:前后端词云数据交互,前后端折线图数据交互,前端页面展示。
四、项目展示:
文末有源码地址,希望多多支持!!
1、数据导入展示:
将所有类别的新闻导入数据库。以树形目录的形式显示新闻类别,每个树形节点代表新闻类别,将这样的新闻放在括号中,选中每条新闻,以列表的形式显示新闻标题,点击新闻标题,就可以查看详细信息。
[En]
Import all categories of news into the database. Show the news category in the form of a tree catalog, each tree node represents the news category, the number of such news in parentheses, select each news, display the news title in the form of a list, click the news title, you can view the details.
1.1将excel里的新闻数据导入mysql
首先,建立八大类新闻数据表和一般新闻数据表:
[En]
First of all, establish eight categories of news data tables and general news data tables:
1.2在前端页面建立新闻类别的树形目录
index.jsp:
finance.jsp:
其他类型的新闻显示界面也类似。
[En]
Other types of news display interfaces are similar.
1.3 新闻详细内容查看界面
点击标题后的视图,即可显示相应内容
[En]
Click the view after the title to display the corresponding content
1.4 前端目录结构
2、文章统计:
2.1 建立新闻数据统计表
2.2 将数据库的数据从后端导出
建立Bean层:
建立Dao层
建立DB层:
建立servlet层
2.3 将后端的数据通过ajax传到前端页面
2.4 效果展示:
3、文章分词:
使用中文分词算法对所有的新闻文本进行分析,统计每个单词的数量,并以单词云图的方式显示出来。点击单词云图以显示其数字。
[En]
Use the Chinese word segmentation algorithm to analyze all the news texts, and count the number of each word, and display it in the way of a word cloud map. Click on the word cloud map to show its number.
3.1建立python项目,将各类型新闻内容分别放在txt文件中(以教育新闻为例)
3.2 用python连接mysql数据库,然后将jieba分词的结果导入mysql
建立分词统计表后,导入jieba依赖:
import jieba
import jieba.analyse
import pymysql
运行项目,得到分词统计结果:
3.3 将分词结果表中的数据用ajax技术导入到前端词云界面
3.4 效果展示:
总词云:
分类词云:
以上即为项目的所有内容。
项目源码地址:https://pan.baidu.com/s/1HJ9hBG0CSPDWJYkDz1QdDg
提取码联系QQ676892048,希望多多点赞,评论支持
Original: https://www.cnblogs.com/nzpdbk/p/15656982.html
Author: 风中明月
Title: 大型数据库的应用项目之基于中文新闻分词绘制词云图
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/522649/
转载文章受原作者版权保护。转载请注明原作者出处!