Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hotel Booking Analytics & RAG System

Overview

This project is an interactive system that processes hotel booking data, generates dynamic analytics, and supports retrieval-augmented question answering (RAG). The system uses a REST API built with FastAPI, a PostgreSQL database for data storage, and a Streamlit-based frontend for interactive visualization and user interaction.

Features

  • Analytics: Generate interactive charts for revenue trends, cancellation rates, geographical distribution, booking lead time, ADR distribution, stay duration, and monthly trends.
  • Question Answering: Utilize a RAG pipeline combining FAISS, LangChain, and the Ollama model to answer natural language questions about hotel bookings.
  • Dynamic Data Updates: Insert new booking records and automatically update insights using PostgreSQL triggers and notifications.
  • Health Check: Monitor the health status of core components including the database, vector store, and QA chain.

Tech Stack

  • FastAPI & Uvicorn: Fast, asynchronous REST API development.
  • PostgreSQL: Reliable, scalable relational database with real-time notifications.
  • Pandas, Matplotlib, Seaborn, Plotly: Data manipulation and interactive visualization.
  • Streamlit: User-friendly frontend for real-time dashboard display.
  • LangChain with Ollama (phi4:latest): RAG pipeline for high-quality context-aware question answering.
  • Ollama Embedding Model (nomic-embed-text): Advanced text encoder for accurate embeddings.
  • FAISS: Efficient vector search and storage for retrieving insights.

Architecture Design

System Architecture Design

Installation and Setup

Prerequisites

Ensure you have the following installed:

  • Python (>=3.8)
  • pip (Python package manager)
  • Ollama software
  • PostgreSQL
  • Hotel Booking Dataset [ hotel_bookings_sampled_5k.csv ]

Step-by-Step Guide

  1. Clone the Repository

    git clone https://github.com/HR-04/Hotel-Booking.git
    cd Hotel-Booking
  2. Create a Virtual Environment (Recommended)

    python -m venv myenv
    source myenv/bin/activate  # On Windows: myenv\Scripts\activate
  3. Install Dependencies

pip install -r requirements.txt
  1. Set Up ollama and PostgreSQL DB
  • Ollama pull phi4:latest [ Your Choice ]
  • Ollama pull nomic-embed-text [ Your Choice ]
  • Create a Table and Insert data in PostgreSQL [ hotel_bookings_sampled_5k.csv ]
  1. Run the application
  • Start the Backend:

    cd backend
    uvicorn main:app --reload
  • Run the Frontend:

    cd frontend
    streamlit run main.py
  1. Access the Application

About

Hotel Booking is an interactive system that processes hotel booking data, generates dynamic analytics, and supports retrieval-augmented question answering (RAG).

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages