text_analysis.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:CloudMusic-Crawler 作者: GreatV 项目源码 文件源码
def generate_wordcloud(words_list, mask_path):
    text = ' '.join(words_list)
    # print text
    mask = np.array(Image.open(mask_path))
    # stopwords = set(STOPWORDS)
    # stopwords.add(u'')

    wc = WordCloud(font_path = 'data/SourceHanSerifCN-Regular.otf', background_color = 'white', 
        max_words = 2000, mask = mask) # ??????????

    wc.generate(text)

    # wc.to_file('data/path/to/file')

    plt.imshow(wc, interpolation='bilinear')
    plt.axis("off")
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号