Semantic-aware transformation of short texts using word embeddings: An application in the Food Computing domain (2021)

Abstract: Most works in food computing focus on generating new recipes from scratch. However, there is a large number of new online recipes generated daily with a large number of users reviews, with recommendations to improve the recipe flavor and ideas to modify them. This fact encourages the use of these data for obtaining improved and customized versions. In this thesis, we propose an adaptation engine based on fine-tuning a word embedding model. We will capture, in an unsupervised way, the semantic meaning of the recipe ingredients. We will use their word embedding representations to align them to external databases, thus enriching their data. The adaptation engine will use this food data to modify a recipe into another fitting specific user preferences (e.g., decrease caloric intake or make a recipe). We plan to explore different types of recipe adaptations while preserving recipe essential features such as cuisine style and essence simultaneously. We will also modify the rest of the recipe to the new changes to be reproducible.

## introduction our dietary habits have a huge impact on health and, thus, in quality of life. in the last decades, the amount of nutritional data available has notably increased. this fact, together with the ubiquity of smartphones, has encouraged the use of machine learning techniques for automatizing some tedious and repetitive tasks as diet generation. in this context, the food computing concept refers to the use of food data to improve the quality of life as well as understanding human behavior @xcite . recipes and their composition have been largely studied in food computing, especially in the food recommendation systems field @xcite . these systems mainly perform recipe-based nutrition assessment, looking for suitable combinations to user preferences. the use of predictive algorithms to understand relations between recipes has emerged in the last years @xcite . recently, authors have taken advantage of these tools to generate synthetic food data. recipe generation is a current area of research, and the latest works in the area have put their interest in the creation of synthetic recipes. however, these works have focused on automatized text generation from scratch instead of taking direct advantage of the already existing recipes to generate new versions. in this thesis, we will address the problem of partially-generation of recipes. particularly, we will put our effort into recipe adaptation and recipe completion tasks. online cooking communities and social media generate daily a huge amount of food data, mostly cooking recipes that users want to share with the world. in these communities, many users review the shared recipes, often giving feedback, customization, and suggestions for tasty versions of a given recipe. we plan to use this information to generate new recipe versions. particularly, we will modify recipes to fulfill the user's requests. there are many reasons to modify a recipe, e.g., a diet restriction such as vegan or vegetarian diets, a lack of ingredients at home, to make the recipe tastier or cooking a kid-friendly version. also, many users follow restricted diets linked to nutritionist personalized assessment. a user would require a light version of a given recipe or including high-protein ingredients, among others. we propose to automatize the process of ingredient modification in a recipe and extend this idea with a recipe completion task. in both cases, we can consider several criteria simultaneously, such as those mentioned before. thus, we tackle twofold challenges here; we have to preserve the semantic of the recipe and its essence while combining heterogeneous sources to incorporate nutrition and user knowledge during the adaptation. here, a specific-domain language model can able us to tackle both purposes. we propose to use a fine-tuned word embedding model as the base of our contribution. we will use it to model the recipe ingredients to incorporate useful information from external sources (i.e., complete the ingredient data with nutrition information, user tips, and cuisine styles). then, we will use the merged data in an adaptation function to find the most suitable foods to adapt a recipe to given restrictions. the semantic information combined with the external data will be the base of the adaptation engine. but adapting recipes do not only consist of dealing with ingredients. likewise, we will use this model for a synthetic adaptation of title, recipe steps, and extra recipe data affected in the process. ## related work cooking recipes have been largely explored in food computing @xcite . last recipe-based works in food computing have surrounding agreed with the advantages of data mining techniques to understand how people cook. regarding the use of natural language processing approaches to resolve food computing tasks, they have been mainly focused on the analysis of cuisines and ingredient relations @xcite . from a wide perspective, these relations have been addressed by using the textual description of foods and flavor networks. the latter has been widely studied with statistical natural language processing methods @xcite @xcite . our proposal is particularly related to the following topics. ## proposed methodology we have divided our approach into two tasks explained in the following subsections. ## evaluation validating recipe adaptations is a subjective procedure. depending on the cultural factor, the type of meal, the flavors, and other intrinsic combinations, what could be an excellent recipe for a user, could result to be untasted for another different one. this variability makes it difficult to measure the adequacy of an adapted recipe. to tackle this variability, we plan to evaluate the proposed method with an online survey on both regular and expert users. for this, we will generate adapted recipes for different circumstances. each recipe will receive a score, where the lowest value represents that the adapted recipe is disgusting and the highest is a very succulent recipe. also, we plan to obtain adaptation suggestions in this step to use them as feedback for future improvement. ## strengths with the arising of technology and, consequently, the large amount of recipes shared on the internet, food computing has played an undeniable role in recipe retrieval systems. these systems allow access to online recipes to speed up the recipe searching whenever a user wants to prepare a dish. we believe that the integration of our approach in the cited software could meet user needs when looking for cooking inspiration. additionally, it is worth noting that a recipe-based word embedding model could be able to participate in multiple problems of food computing. one of its applications is using them for detecting recipe similarity to ensure variety in nutrition assessment systems. we believe that food computing is not the only application of our approach. personalized beauty treatment is another area in which our proposal could be useful. commonly, there can be found on the internet many natural beauty care recipes consisting of a list of ingredients and instructions to create beauty remedies for different purposes. among other many factors, this kind of treatment handles user expectations, allergies, and the cos-metic composition of the treatment. a transfer learning model in this area could be applied to adapt these kinds of treatments to the user's needs. ## summary our proposal consists of using a transfer learning model in the food domain to adapt recipes to fulfill user needs. the challenge remains in using the model for two different tasks. first, we plan to use the model to complete ingredients information with data from external sources, such as nutritional data or cuisine traditions. thus, we will employ this joined data for adapting a recipe to fulfill a need. then, we will use the language model to adequate the rest of the recipe to be consistent with the adapted ingredients.