Determining proper quantities for ingredients is an essential part of cooking practice from the perspective of enriching tastiness and promoting healthiness. We introduce KitchenScale, a fine-tuned Pre-trained Language Model (PLM) that predicts a target ingredient's quantity and measurement unit given its recipe context. To effectively train our KitchenScale model, we formulate an ingredient quantity prediction task that consists of three sub-tasks which are ingredient measurement type classification, unit classification, and quantity regression task. Furthermore, we utilized transfer learning of cooking knowledge from recipe texts to PLMs. We adopted the Discrete Latent Exponent (DExp) method to cope with high variance of numerical scales in recipe corpora. Experiments with our newly constructed dataset and recommendation examples demonstrate KitchenScale's understanding of various recipe contexts and generalizability in predicting ingredient quantities. We implemented a web application for KitchenScale to demonstrate its functionality in recommending ingredient quantities expressed in numerals (e.g., 2) with units (e.g., ounce).
翻译:确定配料恰当用量是烹饪实践中提升美味与促进健康的关键环节。本文提出厨房秤(KitchenScale)——一个微调后的预训练语言模型(PLM),能够根据给定的食谱上下文预测目标配料的用量和计量单位。为高效训练厨房秤模型,我们构建了一个包含三个子任务的配料用量预测任务:配料计量类型分类、单位分类和用量回归任务。此外,我们利用烹饪知识迁移学习将食谱文本知识注入预训练语言模型。针对食谱语料中数值尺度的高方差问题,我们采用离散潜在指数(DExp)方法加以应对。基于新构建数据集和推荐示例的实验表明,厨房秤能理解多样化食谱上下文,并在预测配料用量方面展现出泛化能力。我们部署了厨房秤网页应用,以演示其推荐以数字(如2)和单位(如盎司)表示的配料用量的功能。