A few days ago I wrote two articles using PythonCollect netease cloud lyricsandCollect netease Cloud Music songsArticle, I believe that friends can successfully collect the songs they want to listen to after practice. The following lyrics are collected by xiaobian in November last year. According to statistics, the number of lyrics reached nearly 150,000.Folk lyrics collected in Python

Fancy using Python to analyze what folk singers are singing about

First of all, jieba library is used for word segmentation and word frequency statistical analysis to obtain the word frequency statistics of the lyrics. Some main codes are shown as the figure below:Jieba database was used for word segmentation and word frequency statistical analysis

Import the obtained word frequency into Excel, as shown in the following figure:

Word frequency statistics of folk singers

The word cloud is used to visualize it, and the effect picture is as follows:

Lyric word cloud visualizationLyric word cloud visualization

From the word frequency, we can feel that folk singers often refer to youth, lamenting that youth is fleeting, and the young birds will never come back. They may feel lonely, but they are not immersed in sadness. Instead, their hearts are long for the distance, full of hope for the whole world and full of sunshine for the future. Heh heh, folk singers are spreading positive energy

Then, the seasons that singers like are analyzed by word frequency statistics, and the data statistics obtained are shown in the figure below:Folk singers like the season

As can be seen from the pie chart, folk singers prefer spring to wait for the return of the next spring. Snow in a foreign land covered the spring

Continue the analysis of folk singers’ lyrics to find out what day folk singers like to live, as shown below:What day do folk singers like to live

As can be seen from the bar chart, folk singers prefer tomorrow and are full of hope for it. They say I bet my youth on tomorrow, and it makes sense. Love, can you feel that tomorrow has come? But I don’t know where tomorrow’s ship will dock

Based on the word frequency statistics of city locations, explore which city folk singers like the most, and the statistical graph is as follows:Which city do the folk singers like best

It is obvious that Beijing is beating other cities. In the southern cities, chengdu is still the city that folk singers talk about most. When we walk around chengdu, woo-hoo, woo-hoo, of course, Nanjing, Shanghai and Kunming have also been mentioned, but they don’t carry much weight.

So do folk singers prefer the north or the south? Take a look at the picture below.South or north?

As you can see, folk singers like southern girls. In a northern village lived a southern girl; Southern girl, are you accustomed to the cool autumn in the north? Southern girl do you like northerners straightforward ~ zhao lei song “southern girl” sent to you ^_^

Finally, SnowNLP was used to make emotional analysis of the lyrics of each folk singer, and the statistical figure obtained is as follows:Emotional analysis of folk singers

It can be seen that the emotion expressed in Xu Wei’s songs is relatively high and full of positive energy; But zhao Lei, Escape Plan and others sing songs that express more gentle emotions, like telling you a story in no hurry; The songs of Yao 13 and others are relatively sad. Still, the mood among folk singers was generally upbeat.

Finally, let’s summarize what the folk singer is singing. Is it loneliness? Of course not.

Through the analysis of 150,000 ballad lyrics, we can conclude that ballad singers often lament youth and feel that youth is fleeting. Usually, they feel lonely, but they are not immersed in sadness. Instead, their hearts are long for the distance, full of hope for the whole world, and full of sunshine for the future. They like spring and winter, like to live in tomorrow, full of confidence and hope for the future. They love northern Cities, especially The capital Beijing, but they also love southern Chinese girls. The most popular southern cities they want to visit are Chengdu, Nanjing, Hong Kong and Kunming