diff --git a/生成词云.py b/生成词云.py deleted file mode 100644 index a4de0af..0000000 --- a/生成词云.py +++ /dev/null @@ -1,23 +0,0 @@ -import jieba -import wordcloud -import imageio -#1.读取弹幕数据 -f =open("总弹幕.txt",encoding='utf-8') -text =f.read() -#2.分词 -text_list=jieba.lcut(text) -text_str=' '.join(text_list) -#3.词云图 -f2=open("中文常见停用词.text",encoding='utf-8') -text2=f2.read().splitlines()#读取弹幕 -img= imageio.v2.imread('地球.png')#导入词云形状的图片 -wc=wordcloud.WordCloud(#设置词云格式 - width=1160,#宽 - height=800,#高 - background_color='white',#背景颜色 - mask=img,#云图样式 - stopwords=text2,#禁用词 - font_path='msyh.ttc'#字体 -) -wc.generate(text_str) -wc.to_file('词云图.png') \ No newline at end of file