Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

A few days ago, I wrote two articles using Python to collect NetEase Cloud lyrics and NetEase Cloud music songs . I believe that after practice, my friends can successfully collect the songs they want to listen to. The following lyrics are the ballad lyrics collected by the editor in November last year. After statistics, the number of lyrics has reached nearly 150,000.

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

Ballad lyrics collected in Python

On a whim, I want to use Python to analyze what the hell the folk singers are singing about~~

First, use the jieba library to perform word segmentation and word frequency statistical analysis to obtain word frequency statistics in the lyrics. Some of the main codes are shown in the following figure:

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

Use jieba library for word segmentation and word frequency statistical analysis

After the obtained word frequency is imported into an Excel table, the details are as follows:

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

Folk singer word frequency statistics table

Use the word cloud to visualize it, and the effect diagram is as follows:

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

Lyrics word cloud visualization

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

Lyrics word cloud visualization

From the frequency of words, we can feel that folk singers often mention youth, lamenting that youth is fleeting, and the birds of youth never come back. They will feel very lonely, but they are not immersed in sadness, but longing for the distance in their hearts, full of hope for the whole world, and full of sunshine for the future. Hey, folk singers are sending positive energy~~

After analyzing the seasons that singers like through word frequency statistics, the obtained statistics are shown in the following figure:

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

season of folk singers

It can be seen from the pie chart that folk singers prefer spring~~waiting for the next spring to come back; the snow floating in a foreign land covers the spring~~

Continue to analyze the lyrics of folk singers and explore which day folk singers like to live. The details are shown in the following figure:

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

What day do folk singers like to live on?

It can be seen from the bar chart that folk singers prefer tomorrow and are full of hope for tomorrow. Everyone said that I bet my youth on tomorrow, which seems to make sense. Lover, you can feel that tomorrow has come; but you don't know where the ship of tomorrow will be docked~~

Through the word frequency statistics of city locations, explore which city the folk singers like the most, and the obtained statistics are as follows:

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

Which city do folk singers like the most?

It can be clearly seen that Beijing directly outperforms other cities. In the southern cities, Chengdu is the most talked about by folk singers. Walk with me on the streets of Chengdu, oh oh oh ~~~ Of course, Nanjing, Shanghai, and Kunming are also mentioned, but the weight is not large.

So do folk singers prefer the South or the North? Take a look at the picture below and you will know.

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

It can be seen that the folk singers still quite like the southern mushroom. A girl from the south lives in a village in the north; are you a girl in the south used to the cool autumn in the north; girl in the south, do you like the straightforwardness of a northerner~~~ Zhao Lei's song "Girl in the South" is for you ^_^

Finally, SnowNLP is used to perform sentiment analysis on the lyrics of each folk singer, and the obtained statistics are as follows:

Python boss analyzes 150,000 lyrics to tell you what folk singers are singing

Sentiment Analysis of Folk Singers

It can be seen that the emotions expressed in Xu Wei's songs are relatively hilarious and full of positive energy; while the songs sung by Zhao Lei, Escape Plan and others express relatively gentle emotions, as if they are telling you in a calm manner. Story; Yao Shisan and others' songs are relatively sad. But then again, folk singers are generally happy.

Finally, the editor summarizes what the folk singer is singing, is it lonely? Of course not~~~

Through the analysis of the lyrics of 150,000 folk songs, we can conclude that folk singers often lament their youth and feel that youth is fleeting. Usually, they will feel very lonely, but they are not immersed in sadness, but longing for the distance in their hearts, full of hope for the whole world, and full of sunshine for the future. They like spring and winter, they like to live in tomorrow, and they are full of confidence and hope for the future. They like cities in the north, especially the capital Beijing, but at the same time, they also miss southern girls. The southern cities they most want to go to with girls are Chengdu, Nanjing, Hong Kong and Kunming~~

The above views are for your reference only, and you are welcome to make bricks~~

^_^ Finally, I wish everyone a happy weekend ^_^

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325387905&siteId=291194637