Skip to content

sharmasundip/PersonalizedPlatePlannerAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Food Recommendation Engine

This project is a food recommendation engine that processes order data from CSV files, categorizes food items using a local LLM (Ollama), and generates recommendation rules.

Prerequisites

  • Python 3.10 or higher
  • Pip for package management
  • A running instance of Ollama with the llama3.2 model.

Setup

  1. Clone the repository:

    git clone <repository_url>
    cd <repository_name>
  2. Create and activate a virtual environment:

    python3 -m venv .env
    source .env/bin/activate
  3. Install the required dependencies:

    pip install -r requirements.txt

How to Run

This project involves two main components: a data processing pipeline and a Flask web application.

1. Data Processing Pipeline (src/pipeline.py)

This script processes raw order data, categorizes food items, and generates recommendation rules.

To run the data processing pipeline, execute the following command from the root of the project:

python src/pipeline.py

This will:

  • Read all CSV files from the data/rawData directory.
  • For each file, it will extract unique food items.
  • Categorize the items using the Ollama Llama3.2 model.
  • Generate two rule files (rules.json and user_history.json) and save them in a new directory under model/<restaurant_name>/.

2. Flask Web Application (src/app.py)

This application provides an API endpoint to get meal suggestions based on the pre-generated rules.

To start the Flask web application, execute the following command from the root of the project:

python src/app.py

This will start a local development server, typically accessible at http://127.0.0.1:5000/.

API Endpoint: /get_meal_suggestions

You can access the meal suggestion API using the following examples:

  • Get general suggestions for a restaurant: http://127.0.0.1:5000/get_meal_suggestions?restaurant=Nagarjunasuites

  • Get personalized suggestions for a user: http://127.0.0.1:5000/get_meal_suggestions?restaurant=Nagarjunasuites&user_phone_number=916383728873

  • Get suggestions based on items in the cart: http://127.0.0.1:5000/get_meal_suggestions?restaurant=Nagarjunasuites&items_in_cart=Dal%20Tadka,Plain%20Rice

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages