# 根据传入的背景图片路径和词频字典.字体文件,生成指定名称的词云图片 def generate_word_cloud(img_bg_path, top_words_with_freq, font_path, to_save_img_path, background_color='white'): # 读取背景图形 img_bg = imread(img_bg_path) # 创建词云对象 wc = WordCloud(font_path=font_path, # 设置字体 background…