Contextual Sentence Embeddings for Obtaining Food Recipe Versions - Morales-Garzón, Andrea; Gómez-Romero, Juan; Martín-Bautista, Maria J. (Information Processing and Management of Uncertainty in Knowledge-Based Systems, 2022)
Food and culinary activities related to cooking are present in our daily lives. The rise of food-related data has led to the term food computing, which refers to the study and development of computer systems to solve food-related tasks. Despite the large number of food computing systems focused on the collection, recommendation, retrieval, and creation of recipes, very few have used existing recipes to get adapted versions for user requirements. In this work, we have developed a method for adapting recipes that suggests food options for substituting their ingredients based on food relations and text similarity. For this purpose, we employ different deep learning language models based on BERT. These models incorporate attention mechanisms to extract contextual representations of foods using different strategies to build the word embeddings. We use them to conduct a semantic comparison task for detecting similar ingredients between the recipe ingredients and a food dataset. The results show that the method obtains high-quality recipe versions, thanks to context data, attention mechanisms, and the token representation strategy used for the foods.