Application project of large database: drawing word cloud map based on Chinese news word segmentation


Project: drawing word cloud based on Chinese news word segmentation

1、 Key implementation of the project: Jieba Chinese word segmentation, word segmentation result statistics, word cloud display, front-end tree structure display

2、 Key technologies of the project: JSP, servlet, MVC mode, AJAX, echarts, MySQL database, Jieba word segmentation, python.

3、 Key steps of the project: front and back word cloud data interaction, front and back line chart data interaction, front-end page display.

4、 Project presentation:

      There is a source code address at the end of the article. I hope you can support it!!

1. Data import presentation:

Import all categories of news into the database. The news categories are displayed in the form of tree directory. Each tree node represents the news classification, and the number of such news is represented in parentheses. Select each news and display the news title in the form of list. Click the news title to view the details.

1.1 import the news data in Excel into MySQL

Firstly, eight categories of news data tables and total news data tables are established respectively:

1.2 create a tree directory of news categories on the front page




Other types of news display interfaces are similar

1.3 view interface of news details

   Click view after the title to display the corresponding content

1.4 front end directory structure


2. Article statistics:

2.1 establishment of news data statistics



2.2 export database data from the back end

Create bean layer:


Establish Dao layer


Establish DB layer:


Build servlet layer

2.3 transfer the back-end data to the front-end page through Ajax

2.4 effect display:


3. Article participle:

 Use the Chinese word segmentation algorithm to analyze all news text, count the number of each word, and display it in the form of word cloud diagram. Click the word in the word cloud diagram to display its number.

3.1 establish a python project and put various types of news contents in txt files respectively (taking education news as an example)

3.2 connect the MySQL database with Python, and then import the results of Jieba word segmentation into mysql

Import Jieba dependency after creating word segmentation statistics table:

import jieba

import jieba.analyse

import pymysql

Run the project to get the word segmentation statistical results:

3.3 import the data in the word segmentation result table into the front-end word cloud interface with Ajax technology

3.4 effect display:

Total word cloud:

Category cloud:

The above is all the contents of the project.

Project source code address:

Contact qq676892048 for the extraction code. I hope you can give me more praise and comments

Recommended Today

Explanation of websocket heartbeat reconnection

Recently, websocket has been used in the development of applet. The applet provides corresponding native API, which is different from H5 API. Therefore, some mature class libraries of popular H5 are difficult to use, and the native API has some defects, so it implements a set of heartbeat reconnection mechanism by itself. First, let’s briefly […]