Skip to main content
QUICK REVIEW

[Paper Review] Deep Learning Based Named Entity Recognition Models for Recipes

Mansi Goel, Ayush Agarwal|arXiv (Cornell University)|Feb 27, 2024
Topic ModelingComputer Science5 citations
TL;DR

The paper builds and evaluates NER models for recipe text using manually annotated, augmented, and machine-annotated datasets, finding spaCy-transformer with macro-F1 around 96% as the best performer, while few-shot prompting LLMs performs poorly.

ABSTRACT

Food touches our lives through various endeavors, including flavor, nourishment, health, and sustainability. Recipes are cultural capsules transmitted across generations via unstructured text. Automated protocols for recognizing named entities, the building blocks of recipe text, are of immense value for various applications ranging from information extraction to novel recipe generation. Named entity recognition is a technique for extracting information from unstructured or semi-structured data with known labels. Starting with manually-annotated data of 6,611 ingredient phrases, we created an augmented dataset of 26,445 phrases cumulatively. Simultaneously, we systematically cleaned and analyzed ingredient phrases from RecipeDB, the gold-standard recipe data repository, and annotated them using the Stanford NER. Based on the analysis, we sampled a subset of 88,526 phrases using a clustering-based approach while preserving the diversity to create the machine-annotated dataset. A thorough investigation of NER approaches on these three datasets involving statistical, fine-tuning of deep learning-based language models and few-shot prompting on large language models (LLMs) provides deep insights. We conclude that few-shot prompting on LLMs has abysmal performance, whereas the fine-tuned spaCy-transformer emerges as the best model with macro-F1 scores of 95.9%, 96.04%, and 95.71% for the manually-annotated, augmented, and machine-annotated datasets, respectively.

Motivation & Objective

  • Create large, diverse datasets of recipe ingredient phrases (manual, augmented, machine-annotated) for robust NER training.
  • Benchmark traditional and deep-learning NER methods on recipe data to establish state-of-the-art performance.
  • Assess data augmentation and sampling strategies to maximize diversity and model generalization.
  • Evaluate the feasibility of few-shot prompting on large language models for recipe NER.
  • Analyze tag-wise learnability to understand which entity types are more challenging in recipe text.

Proposed method

  • Dataset construction: manual annotation of 6,611 ingredient phrases, augmentation to 26,445 phrases, and machine-annotated corpus from RecipeDB totaling 349,762 phrases coordinated via SEFS clustering.
  • Data preprocessing with lemmatization and error pattern correction by culinary experts.
  • Model configurations: reimplementation of Stanford NER (CRF) and fine-tuning of encoder-based models (BERT, DistilBERT, RoBERTa, DistilRoBERTa) and NLP frameworks (spaCy, flair).
  • Training setup: base models fine-tuned with SGD, learning rate 0.01, on NVIDIA A100 with batch size 44 for up to 12 epochs.
  • Evaluation: macro-F1, precision, and recall on three datasets (Manually Annotated, Augmented, Machine-Annotated).
  • Few-shot prompting experiments on LLMs (e.g., LLaMA, Mistral, Vicuna) to compare against supervised fine-tuning.

Experimental results

Research questions

  • RQ1Can large, diverse recipe ingredient phrase datasets improve NER performance for recipe texts?
  • RQ2Which NER modeling approach (CRF baseline vs. encoder-based transformer models) yields the best macro-F1 on recipe data?
  • RQ3Do data augmentation and machine-annotated datasets help or hinder NER performance?
  • RQ4Are few-shot prompts with current LLMs effective for recipe NER without fine-tuning?
  • RQ5What are the tag-wise learnability patterns for recipe NER (e.g., which entity types are easier or harder)?

Key findings

  • The spaCy-transformer achieved the best macro-F1 scores across all three datasets: 95.9% (Manually Annotated), 96.04% (Augmented), and 95.71% (Machine-Annotated).
  • Augmented data provides modest gains for some models, while machine-annotated data can introduce noise and slightly reduce performance.
  • Distil variants often rival or outperform base BERT models, possibly due to reduced overfitting and noise sensitivity.
  • Few-shot prompting on state-of-the-art LLMs yielded poor macro-F1 scores (e.g., 5.88–32.90% range depending on model), indicating limited domain adaptation without fine-tuning.
  • The Quantity tag learns quickly while Temperature lags, indicating data frequency influences learnability and model reliance on memorization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.