基于Python的美食数据爬取及可视化研究
2021-06-28依力·吐尔孙艾孜尔古丽
依力·吐尔孙 艾孜尔古丽



摘要:本文主要研究中国菜谱里面的美食词汇资源的爬取、构建、数据处理并对词汇资源进行数据可视化分析。本文首先采用Python语言使用Scrapy框架进行数据爬取并对目标网站的网页进行页面分析,采集的是豆果美食网里最新发布的中国菜系菜谱,然后用Pandas、Numpy等库进行清洗数据并做可视化分析。除此之外,用Pyecharts库制作各大菜系菜品量的饼状图。最后通过Jieba库进行中文分词处理,筛选出高频词汇并制作了词云图。为了使乏味的文本数据散发活力,深入分析数据,以词云图展示数据分析的结果,增加数据可视化。
关键词:美食词汇;Python;网络爬虫;数据分析;词云图
中图分类号:TP391 文献标识码:A
文章编号:1009-3044(2021)10-0019-02
Abstract: This paper mainly studies the crawling, construction, data processing and data visualization analysis of Chinese cuisine vocabulary resources in Chinese recipes. In this paper, we first use Python language to Scrapy framework to crawl data and analyze the web pages of the target website. We collected the latest Chinese cuisine recipes from the Douguo Cuisine Network. Then we use libraries such as Pandas and Numpy to clean the data and do visual analysis. In addition, Pyecharts library is used to make pie charts of the quantity of dishes in each major cuisine. Finally, word segmentation is carried out through JIEBA library to screen out high-frequency words and make word cloud map. In order to make boring text data exude vitality, in-depth analysis of the data, the word cloud map to show the results of data analysis, increase data visualization.
Key words: food vocabulary; Python; Web crawler; Data analysis; Word cloud
非典、新冠肺炎等致命性疾病讓人们更加意识到健康饮食习惯的重要性。人工智能、大数据的发展对饮食词汇数据的处理方面带来了便利。不仅,计算语言学、统计学等交叉学科的发展使得处理饮食词汇资源的数据引来了新思路和新角度,而且处理这些饮食数据资源促进了中国饮食文化、膳食结构、营养学、预防疾病学等学科方面的研究。
构建饮食词汇资源并进行数据可视化对研究民俗饮食有着重要作用,这些数据有利于分析各地民俗饮食的结构。为进一步开展食物资源和增加菜谱品种方面的研究,对各个地方不同菜谱的原料及其用料使用情况、食品加工、饮食制作、饮食命名和饮食传承有关的信息进行数据采集并对数据进行可视化研究是有必要的。……
