Did not see "Qingyu years" TV series and novels, I probably know these

------ science students see "Qingyu years" with technical methods ------

Recent TV series "Qingyu years" on several microblogging hot search, around a lot of friends are discussing the show.

"Qingyu year" starring Zhang Ruoyun, Li Qin, Chen Daoming, who costume drama. High-profile launch before the show, many viewers to see if competent actor Zhang Yun and Chen Daoming same old drama of bone box, subconsciously thought it was a seriousness of drama, the result is not.

Evaluation is also the polarization: "There is no destruction of fiction" and "old drama of bone acting high", "There is no reason not to focus on the show, after all, this year was one of my most favorite novels";
"probably expect too much some stories are not really suitable for film and television. "

Since we do not have time to watch TV technology male and original, but we can learn other ways ah, Just do it.

Alone use technology to analyze the original

Alone use technology to see how the original, which is the basic version of the Python word cloud generated code:

from wordcloud import WordCloud, ImageColorGenerator, STOPWORDS
import matplotlib.pyplot as plt
from skimage.io import imread

text = open('qingyunian.txt', 'r').read()  # 读取一个TXT文件
bg_pic = imread('beijing.png')
'''设置词云样式'''
wc = WordCloud(
    background_color='white',
    mask=bg_pic,
    font_path='simhei.ttf',
    max_words=2000,
    max_font_size=150,
    random_state=30,
    scale=1.5
)

wc.generate_from_text(text)
image_colors=ImageColorGenerator(bg_pic)
plt.imshow(wc)
plt.axis('off')
plt.show()
print('display success!')
wc.to_file('test.jpg')

Generate word cloud

First, let's take a look at the original basic word cloud generated, there is no filter Chinese stop words:

01

02

Word frequency analysis

image.png

  1. We can see that, "said" the word frequency is extremely high, a lot of dialogue between visible characters.
  2. Then there is a change in the manner of speaking, "said softly," "slowly said," should speak with the status change the way the story characters change.
  3. Fan idle is the original hero, this man certainly liked to laugh - "laughing", "Fan smiled free", "Smile said," "Van smiled free" ...
  4. Must be a costume drama, "Son of Heaven", "Your Majesty" word frequency higher
  5. "Huan front of the hall," "Beijing Jiangnan" high rate of appearance, do not know the story takes place in the southern area.

to sum up

Finally came to the Summary section, but I probably guess, the hero must be a well-thought, more optimistic a person likes to laugh, and then slowly became emperor Reds side of the "Fan adults."

This is a very basic analysis of the original, and significant technical details is not enough, just as an entertaining way of learning Python.

The basic conclusion is that these guess, I would like to note that in this way does not feeling like a machine reading, wonderful character key, the story plot can not be seen, so that I recommend we still see the original bar.

If the analysis is wrong, we welcome comments and criticism pointed out, let me find out more. Interest on the word cloud recommend this site WordArt , without having to write any code can generate interesting word cloud.

Thinking upgrade behind it, to be TV or watercress microblogging comments were a crawl, and then to analyze, look at the views of users of the drama.

Guess you like

Origin www.cnblogs.com/yuzhou-1su/p/12104648.html