Dietary Pattern Extraction Using Natural Language Processing Techniques

Insu Choi, Jihye Kim, Woo Chang KimFrontiers in Nutrition 2022 · DOI

Abstract

In this study, we observed the changes in dietary patterns among Korean adults in the previous decade. We evaluated dietary intake using 24-h recall data from the fourth (2007-2009) and seventh (2016-2018) Korea National Health and Nutrition Examination Survey (KNHANES). Machine learning-based methodologies were used to extract these dietary patterns. Particularly, we observed three dietary patterns from each survey similar to the traditional and Western dietary patterns in 2007-2009 and 2016-2018, respectively. Our results reveal a considerable increase in the number of Western dietary patterns compared with the previous decade. Thus, our study contributes to the use of novel methods using natural language processing (NLP) techniques for dietary pattern extraction to obtain more useful dietary information, unlike the traditional methodology.

Introduction

Identifying dietary patterns is a cornerstone of nutritional epidemiology, essential for understanding the relationship between food consumption and chronic disease risk. However, traditional methodologies—such as factor analysis or manual clustering—often rely on the subjective grouping of food items into broad categories (e.g., "grains" or "vegetables"). This process can introduce researcher bias and obscure granular trends, such as the specific cultural context of "dining out" versus home-cooked meals.

This study, published in Frontiers in Nutrition, proposes a modernization of these techniques by applying Natural Language Processing (NLP) to unstructured dietary data. By treating a participant's daily food intake as a "document" and dietary patterns as latent "topics," the researchers aimed to objectively quantify the "nutrition transition" occurring in South Korea over a ten-year span.

Methodology

The researchers developed a multi-stage machine learning pipeline to process data from the Korea National Health and Nutrition Examination Survey (KNHANES), covering two distinct periods: 2007–2009 (n=16,187) and 2016–2018 (n=16,809).

Data Preprocessing and Cleaning

The pipeline began with the cleaning of over 400,000 food name entries. To address the linguistic complexities of the Korean language, the team utilized "Hanspell" for spell-checking and decomposed words into phonetic units (jamo). This allowed the model to recognize similarities between regional dialects and common typing errors in the survey data.

Figure 1: Overview of the data preprocessing and machine learning pipeline used to extract dietary patterns.

Machine Learning Implementation

Two primary NLP techniques were employed:

  1. Word Embeddings (fastText): Food names were converted into high-dimensional vectors. Unlike traditional word-count methods, fastText captures subword information, ensuring that variations like "Chocolett" and "Chocolate" are mapped to similar vector spaces.
  2. Topic Modeling (Latent Dirichlet Allocation): LDA was used to identify clusters of foods that frequently co-occur. The optimal number of topics (dietary patterns) was determined mathematically using perplexity and topic coherence ($C_V$) scores, resulting in three distinct patterns for each time period.

Results and Discussion

The NLP approach successfully visualized the relationships between thousands of unique food items, as shown in the scatter plot of food name vectors. This high-dimensional mapping allowed the researchers to identify patterns that traditional categorization might miss.

Figure 6: Two-dimensional scatter plot of food name vectors generated via fastText embeddings, illustrating the semantic clustering of food items.

The Shift Toward Westernization

The results quantify a significant shift in the Korean diet over the decade:

  • 2007–2009: All three extracted patterns were variations of the traditional Korean diet, dominated by rice, kimchi, and vegetable-based soups. Approximately 68.4% of participants fell into the primary traditional group.
  • 2016–2018: While a traditional pattern remained (67.1%), two new distinct patterns emerged. Topic 1 (Meat & Alcohol), representing 17.4% of participants, captured the "dining out" signature of pork belly and soju. Topic 3 (Western/Processed), representing 15.5%, was characterized by the rise of Americano coffee, ramen, and fried chicken.

The emergence of "Americano" as a top-ranked item in the latter period highlights the rapid integration of global coffee culture into daily Korean life. Furthermore, the NLP pipeline processed the massive dataset in approximately five minutes, demonstrating a level of efficiency and scalability unattainable through manual coding.

Conclusion

This study demonstrates that NLP techniques like fastText and LDA can provide a more objective, granular, and efficient alternative to traditional dietary pattern analysis. While future work is needed to link these automated patterns directly to clinical health outcomes, this methodology offers a powerful tool for tracking rapid nutritional transitions in large populations. The researchers suggest that developing domain-specific, pretrained NLP models for nutrition could further enhance the accuracy of food classification across diverse cultures.

Summary updated

Abstract

In this study, we observed the changes in dietary patterns among Korean adults in the previous decade. We evaluated dietary intake using 24-h recall data from the fourth (2007-2009) and seventh (2016-2018) Korea National Health and Nutrition Examination Survey. Machine learning-based methodologies were used to extract these dietary patterns. Particularly, we observed three dietary patterns from each survey similar to the traditional and Western dietary patterns in 2007-2009 and 2016-2018, respectively. Our results reveal a considerable increase in the number of Western dietary patterns compared with the previous decade. Thus, our study contributes to the use of novel methods using natural language processing (NLP) techniques for dietary pattern extraction to obtain more useful dietary information, unlike the traditional methodology.
BibTeX
@inproceedings{choi2022dietary,
  author = {Insu Choi and Jihye Kim and Woo Chang Kim},
  title = {{Dietary Pattern Extraction Using Natural Language Processing Techniques}},
  booktitle = {Frontiers in Nutrition},
  year = {2022},
  doi = {10.3389/fnut.2022.765794},
}
Figure