from pyecharts import options as opts
from pyecharts.charts import WordCloud
words = [
('市场主体',30.56),
('中小微企业',27.42),
('营商环境',18.2),
('实体经济',14.83),
('规范发展',14.78),
('伙伴关系协定',14.55),
('小微企业融资',14.55),
('新型城镇化',14.55),
('关键核心技术',14.27),
('职业技能培训',13.8),
('基本养老保险',13.8),
('扩大内需战略',13.8),
('城乡融合发展',13.8),
('放管服',13.05),
('脱贫地区',12.63),
('宏观政策',12.48),
('基础研究',10.37),
('国家实验室',10.37),
('制造业企业',10.37),
('提质',10.36),
('乡村建设',10.36),
('减税政策',10.36),
('直达机制',10.36),
('稳岗',10.36),
('生态系统',8.26),
('经济布局',8.26),
('发展格局',8.07),
('腐败问题',7.76),
('形势变化',7.76),
('资金使用',7.76),
('卫生事业',7.76),
('竞争政策',7.76),
('质量效益',7.76),
('严格落实',7.76),
('贫困劳动力',7.76),
('重大突破',7.76),
('国家自主',7.76),
('就业渠道',7.76),
('科学精准',7.76),
('平台企业',7.76),
('转移支付',7.76),
('扩大失业',7.76),
('有效衔接',7.76),
('补助标准',7.76),
('降费',7.76),
('门诊费用',7.76),
('战略支撑',7.76),
('防范化解',7.76),
('碳排放',7.76),
('医保',7.76),
('行动方案',7.59),
('绿色转型',7.59),
('关键核心技术攻关',3.71),
('预期目标',1.07),
('污染防治',1.04),
]
wordcloud = (
WordCloud()
.add("", data_pair = words, word_size_range=[6,60],textstyle_opts=opts.TextStyleOpts(font_family='Microsoft YaHei',font_weight='bold'))
.set_global_opts(title_opts=opts.TitleOpts(title="《政府工作报告(2021)》新词",title_textstyle_opts = opts.TextStyleOpts(font_size = 25,color="midnightblue")))
.render("2021政府工作报告.html")
)
运行结果如图