Python Word Cloud Analysis Jay Chou "Sunny Day"

Source: Internet
Author: User

First, preface

The stars of the night, they met 、、、
In the summer, she slowly close to him, care about him, for him to pay everything; in the fall, two people finally together, share all happy time but after all, happy time is short, because Jay must go abroad for further study, two people face to separate the situation, the separation of love is always difficult to maintain long-term, They choose to break up in winter.
"Before the past", that with the pain of the heart of the smell, really let people feel a trace of the sad and dreary atmosphere ...
Listen to this melody, always inexplicable a faint sadness, and this sadness will accumulate more dense, slowly occupy their own soul of every corner ...
Beautiful love deeply touched every ops, today we use the Python language to interpret this beautiful love.

Second, the formation of the word cloud
pip install Wordcloud, JiebaImportJieba,wordcloud#choose Jay Chou's "Sunny Day" lyricsMyText ="""the story of the little yellow flower from the year of birth, the swing of childhood swings with memory has been dangling to now ㄖㄨㄟㄙㄡㄙㄡㄒ a ㄉㄡㄒ a ㄌㄚre so that si do si laㄙㄡㄌㄚㄒ one terminations one terminations one terminations one ㄌㄚㄒ one ㄌㄚㄙㄡso la si si-si si la Si La So blowing the prelude to look at the sky I think of the petals try to drop the day that you cut off the class of the days of the classroom that one of the room I can not see the disappearance of the rainy days I would like to shower again did not expect to lose I still have the courage to ask again would you like to wait or leave the wind this day I tried to hold your hand but the rain is getting big I see you don't see how long I can wait for you Sunny day Maybe I'll be better. Once upon a time there was a person who loved you long ago but the wind gradually blowing away from the distance and finally can love one more day but the end of the story you seem to say goodbye for you the day of skipping class the day of the classroom that one of the room I can not see the disappearance of the rainy days I would like to shower again did not think of the courage to lose I still have a good wish to ask again Will you wait or leave the wind this day I tried to hold your hand but the rain is getting so big I don't see how long it will take me to stay by your side until it clears up. Maybe I'll be better than before there is a person who loves you for a long time, but the wind gradually blowing away from the distance and finally can love another day but the end of the story you seem to say goodbye to the wind this day I tried to hold your hand but biased The rain is getting big, I see you don't see how long I can be around you wait for the sunny day maybe I'll be better than once there was a person who loved you for a long time, but the rain is gradually blowing away from the distance is very difficult to love another day but the end of the story you still like to say bye"""MyText=" ". Join (Jieba.cut (mytext)) fromCollectionsImportCounterc=Counter (Text_jieba) C= C.most_common (10)[(' ', 522), ('\ n', 98), ('You're', 19), ('of the', 17), ('I'm', 13), ('Good', 10), ('but',8), ('the', 8), ('again', 7), ('terminations', 7)] fromWordcloudImportWordcloudwordcloud= Wordcloud (font_path="C:\windows\fonts\simhei.ttf"). Generate (MyText)ImportMatplotlib.pyplot as Pltplt.imshow (Wordcloud, interpolation='bilinear') Plt.axis ("if") plt.show ()#Save PictureWordcloud.to_file ('test.jpg')

Analysis of Lyrics Emotion

 fromSnownlpImportSnownlps=SNOWNLP (mytext) forSentenceinchs.sentences:Print (sentence) story of the Little yellow flower from the year of birth, the swing of childhood swings with the memory has been dangling to now ㄖㄨㄟㄙㄡㄙㄡㄒ a ㄉㄡㄒ a ㄌㄚre   So the Si do si laㄙㄡㄌㄚㄒ one terminations one terminations one terminations one ㄌㄚㄒ one ㄌㄚㄙㄡso la si si si-si la  Si La so blowing the prelude to look at the sky I think of the petals try to drop for you the day of the school spent on the day of the classroom that one of the room I do not see the disappearance of the rainy days I would like to shower again did not think of the courage to lose I still want to keep Ask if you will wait or leave the wind this day I tried to hold your hand but the rain is getting big I don't see how long it will take me to stay by your side until it clears up, maybe I'll be better. Once upon a time there was a man who loved you long ago but the wind is fading  The distance is blowing so far and then I can love another day but at the end of the story you seem to say goodbye to the day that you skipped class the day of the classroom that one of the room I can't see disappear rain days I want to go again didn't think of lost  I still have the courage to ask again would you like to wait or leave the wind this day I tried to hold your hand but the rain is getting big I see how long it will take me to stay by your side until the sunny day maybe I'll be better. There was a man before.  Love you for a long time, but the wind gradually blowing away from the distance and finally can love another day but the end of the story you seem to say goodbye to the wind this day I tried to hold your hand but the rain is gradually big to I see you don't see how long I can in you I'll be there for the day when it clears up. Once upon a time there was a person who loved you long ago but the rain is gradually blowing away from the distance and finally can love one more day but the end of the story you seem to have said worship #The emotional analysis results of the first sentenceS1 =SNOWNLP (s.sentences[0]) s1.sentiments0.8849970682062196#Positive Emotion#analysis It's hard to love one more dayS1 = SNOWNLP (s.sentences[-2]) s1.sentiments0.21646625648493734#This is a bad mood.

Iv. Conclusion

Life is learned everywhere, every kind of code learning will make your life colorful, immersed in the Jay of the beautiful song, with emotional code analysis Jay feelings of the world, feel the world all in the code with the beating.

Article Source: 1190000010108177

Mattered perplexed

Python QQ Group: 238757010

Python Word Cloud Analysis Jay Chou "Sunny Day"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.