From 456ebc35a93792ff6a9501f712c684e7d2854529 Mon Sep 17 00:00:00 2001 From: QMZ <1164250597@qq.com> Date: Tue, 17 Sep 2024 23:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo.py b/demo.py index f94597b..24f1b2f 100644 --- a/demo.py +++ b/demo.py @@ -14,7 +14,7 @@ headers = { } keywords = [ - 'AI', '人工智能', '机器学习', '深度学习', '神经网络', '自动', + 'AI', '人工智能', '机器学习', '深度学习', '神经网络', '自动化', '算法', '数据科学', '自然语言', '计算机', '人工智能技术', '大数据', '预测分析', '机器视觉', '智能', '计算机', '人工智能应用', @@ -92,7 +92,7 @@ def wcloud(alltxt): danmustr=''.join(i for i in alltxt) #将所有弹幕拼接在一起 words=list(jieba.cut(danmustr)) #利用jieba库将弹幕按词进行切分 words=[i for i in words if len(i)>1] ###挑出长度大于1的词语(为去除诸如?,哈,啊等字符) - wc=wordcloud.WordCloud(height=1000,width=1000,font_path='simsun.ttc')#利用wordcloud库定义词云图片的信息 + wc=wordcloud.WordCloud(height=1000,width=1000,font_path='simsun.ttc',background_color='white')#利用wordcloud库定义词云图片的信息 wc.generate(' '.join(words)) ##生成图片 print(wc) plt.imshow(wc)