Skip to main content

Contextual Sentence Embeddings for Obtaining Food Recipe Versions

  • Conference paper
  • First Online:

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1602))

Abstract

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://www.who.int/news-room/fact-sheets/detail/healthy-diet.

  2. 2.

    https://www.bbc.co.uk/food.

  3. 3.

    www.kaggle.com/kaggle/recipe-ingredients-dataset.

  4. 4.

    https://www.kaggle.com/nehaprabhavalkar/indian-food-101/version/2.

  5. 5.

    https://www.kaggle.com/sarthak71/food-recipes.

References

  1. Ahn, Y.Y., Ahnert, S.E., Bagrow, J.P., Barabási, A.L.: Flavor network and the principles of food pairing. Sci. Rep. 1(1), 1–7 (2011)

    Article  Google Scholar 

  2. Altossar, J.: food2vec-augmented-cooking-machine intelligence. Jaan Altossar’s blog (2015). Accessed 17 December 2015

    Google Scholar 

  3. Bojanowski, P., Grave, E., Joulin, A., Mikolov, T.: Enriching word vectors with subword information. Trans. Assoc. Comput. Linguist. 5, 135–146 (2017)

    Article  Google Scholar 

  4. Cer, D., Diab, M., Agirre, E., Lopez-Gazpio, I., Specia, L.: Semeval-2017 task 1: semantic textual similarity-multilingual and cross-lingual focused evaluation. arXiv preprint arXiv:1708.00055 (2017)

  5. Chen, M., Jia, X., Gorbonos, E., Hong, C.T., Yu, X., Liu, Y.: Eating healthier: exploring nutrition information for healthier recipe recommendation. Inf. Process. Manag. 102051 (2019)

    Google Scholar 

  6. Fujita, J., Sato, M., Nobuhara, H.: Model for cooking recipe generation using reinforcement learning. In: 2021 IEEE 37th International Conference on Data Engineering Workshops (ICDEW), pp. 1–4. IEEE (2021)

    Google Scholar 

  7. Harper, C., Siller, M.: OpenAG: a globally distributed network of food computing. IEEE Pervasive Comput. 14(4), 24–27 (2015). https://doi.org/10.1109/MPRV.2015.72

    Article  Google Scholar 

  8. Harvey, M., Ludwig, B., Elsweiler, D.: You are what you eat: learning user tastes for rating prediction. In: Kurland, O., Lewenstein, M., Porat, E. (eds.) SPIRE 2013. LNCS, vol. 8214, pp. 153–164. Springer, Cham (2013). https://doi.org/10.1007/978-3-319-02432-5_19

    Chapter  Google Scholar 

  9. Jiang, S., Min, W.: Food computing for multimedia. In: Proceedings of the 28th ACM International Conference on Multimedia. MM 2020, pp. 4782–4784. Association for Computing Machinery, New York (2020). https://doi.org/10.1145/3394171.3418544

  10. Kazama, M., Sugimoto, M., Hosokawa, C., Matsushima, K., Varshney, L.R., Ishikawa, Y.: A neural network system for transformation of regional cuisine style. Front. ICT 5, 14 (2018)

    Google Scholar 

  11. Kim, K.J., Chung, C.H.: Tell me what you eat, and i will tell you where you come from: a data science approach for global recipe data on the web. IEEE Access 4, 8199–8211 (2016)

    Article  Google Scholar 

  12. Majumder, B.P., Li, S., Ni, J., McAuley, J.: Generating personalized recipes from historical user preferences. arXiv preprint arXiv:1909.00105 (2019)

  13. Marin, J., et al.: Recipe1m+: a dataset for learning cross-modal embeddings for cooking recipes and food images. IEEE Trans. Pattern Anal. Mach. Intell. 43(1), 187–203 (2019)

    Article  Google Scholar 

  14. McCance, R.A., Widdowson, E.M.: McCance and Widdowson’s the composition of foods. Roy/ Soc. Chem. (2014)

    Google Scholar 

  15. Metwally, A.A., Leong, A.K., Desai, A., Nagarjuna, A., Perelman, D., Snyder, M.: Learning personal food preferences via food logs embedding. arXiv preprint arXiv:2110.15498 (2021)

  16. Mikolov, T., Chen, K., Corrado, G., Dean, J.: Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781 (2013)

  17. Min, W., Jiang, S., Jain, R.C.: Food recommendation: framework, existing solutions, and challenges. IEEE Trans. Multimedia 22, 2659–2671 (2020)

    Article  Google Scholar 

  18. Min, W., Jiang, S., Liu, L., Rui, Y., Jain, R.: A survey on food computing. ACM Comput. Surv. (CSUR) 52(5), 1–36 (2019)

    Article  Google Scholar 

  19. Min, W., Jiang, S., Sang, J., Wang, H., Liu, X., Herranz, L.: being a supercook: joint food attributes and multimodal content modeling for recipe retrieval and exploration. IEEE Trans. Multimedia 19(5), 1100–1113 (2016)

    Article  Google Scholar 

  20. Min, W., Jiang, S., Wang, S., Sang, J., Mei, S.: A delicious recipe analysis framework for exploring multi-modal recipes with various attributes. In: Proceedings of the 25th ACM International Conference on Multimedia, pp. 402–410 (2017)

    Google Scholar 

  21. Morales-Garzón, A., Gómez-Romero, J., Martin-Bautista, M.J.: A word embedding-based method for unsupervised adaptation of cooking recipes. IEEE Access 9, 27389–27404 (2021)

    Article  Google Scholar 

  22. Morales-Garzón, A., Gómez-Romero, J., Martin-Bautista, M.J.: A word embedding model for mapping food composition databases using fuzzy logic. In: Lesot, M.-J., et al. (eds.) IPMU 2020. CCIS, vol. 1238, pp. 635–647. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-50143-3_50

    Chapter  Google Scholar 

  23. World Health Organization et al.: Healthy diet. Technical report, World Health Organization. Regional Office for the Eastern Mediterranean (2019)

    Google Scholar 

  24. Pennington, J., Socher, R., Manning, C.D.: Glove: global vectors for word representation. In: Empirical Methods in Natural Language Processing (EMNLP), pp. 1532–1543 (2014). http://www.aclweb.org/anthology/D14-1162

  25. Reimers, N., Gurevych, I.: Sentence-Bert: sentence embeddings using Siamese Bert-networks. arXiv preprint arXiv:1908.10084 (2019)

  26. Su, H., Lin, T.W., Li, C.T., Shan, M.K., Chang, J.: Automatic recipe cuisine classification by ingredients. In: Proceedings of the 2014 ACM International Joint Conference on Pervasive and Ubiquitous Computing: Adjunct Publication, pp. 565–570 (2014)

    Google Scholar 

  27. Toneva, M., Wehbe, L.: Interpreting and improving natural-language processing (in machines) with natural language-processing (in the brain). arXiv preprint arXiv:1905.11833 (2019)

  28. Vaswani, A., et al.: Attention is all you need. In: Advances in Neural Information Processing Systems, pp. 5998–6008 (2017)

    Google Scholar 

Download references

Acknowledgements

This project is partially supported by the Andalusian government and the FEDER operative program under the project BigDataMed (P18-RT-2947 and B-TIC-145-UGR18). It is also supported by the Department of Economic Transformation, Industry, Knowledge and Universities of the Junta de Andalucía and the program of research initiation for master students of the University of Granada.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Andrea Morales-Garzón .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Morales-Garzón, A., Gómez-Romero, J., Martín-Bautista, M.J. (2022). Contextual Sentence Embeddings for Obtaining Food Recipe Versions. In: Ciucci, D., et al. Information Processing and Management of Uncertainty in Knowledge-Based Systems. IPMU 2022. Communications in Computer and Information Science, vol 1602. Springer, Cham. https://doi.org/10.1007/978-3-031-08974-9_24

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-08974-9_24

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-08973-2

  • Online ISBN: 978-3-031-08974-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics