Skip to content

matteorigat/natural-language-processing-project

Repository files navigation

🍳 Hurry up, I'm hungry! - Culinary Recipe Generator

This project uses AI to generate novel and plausible culinary recipes based on a user-provided list of ingredients.

⚙️ How It Works:

A two-stage process:

  1. Technique Prediction (Word2Vec):

    • Analyzes input ingredients.
    • Predicts suitable cooking techniques (e.g., bake, boil) based on learned semantic relationships from the dataset.
  2. Recipe Generation (Fine-tuned GPT-2):

    • Takes the original ingredients and the predicted techniques as input.
    • A fine-tuned GPT-2 model, trained on a vast corpus of recipes, generates the complete recipe steps using special tokens ([INGREDIENTS], [TECHNIQUES], [STEPS]) for structured output.

📊 Evaluation

Generated recipes are evaluated against real recipes by:

  1. Finding the most similar real recipes based on ingredient overlap (TF-IDF & Cosine Similarity).
  2. Comparing generated steps to benchmark steps using:
    • ROUGE-L: Measures lexical overlap.
    • BERT Similarity: Measures semantic similarity.

(Dataset: Based on Food.com recipes from Kaggle)

About

NLP project unimi - Culinary Recipe Generator. Word2vec, gpt-2 fine tuning, evaluation framework.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published