# abhishek445566/book-recommendation-system architecture

> Architecture diagram of the GitHub repository abhishek445566/book-recommendation-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhishek445566/book-recommendation-system
- Repository: https://github.com/abhishek445566/book-recommendation-system

## Overview

##### Main Components
- Data Ingestion & Preprocessing: Represent the input data process where raw book data is downloaded (from Kaggle) and cleaned. This corresponds to the “data-exploration.ipynb” notebook.
- Zero-Shot Text Classification: Include a component for classifying books as “fiction” or “non-fiction” using LLMs. This is contained in the “text-classification.ipynb” notebook.
- Sentiment Analysis: Set apart the module that extracts sentiment or emotional tone from text (e.g., suspense, joy, sadness) as shown in the “sentiment-analysis.ipynb” notebook.
- Web Application / User Interface: Illustrate the front-end built using Gradio (represented in “gradio-dashboard.py”) that brings all functionalities together for end users.
- External Services & Configuration: Don’t forget to include the dependency on the OpenAI API (with the configuration via the .env file) and any other external APIs if applicable.

##### Relationships and Interactions
- The Data Ingestion module feeds cleaned data to the Vectorization module.
- The output of vectorization (i.e., vector embeddings) is stored in or accessed from the vector database for semantic search.
- The same cleaned data is processed by the Classification and Sentiment Analysis modules, which annotate the books with additional metadata (e.g., category labels and sentiment scores).
- The Gradio dashboard serves as the entry point for users; it sends natural language queries that are processed by the semantic search component and may incorporate results from the classification and sentiment analysis modules.

##### Architectural Patterns and Technologies
- Data Pipeline: Emphasize a modular data pipeline where each notebook represents a distinct processing module.
- Service Integration: Note the integration with external LLM services via the OpenAI API and how configuration is managed (via the .env file).
- Web Frontend Framework: Mark the Gradio component that creates the web-based user interface, providing an interactive dashboard for book recommendations.

- Converge these processing outputs into a combined “Book Enrichment” stage.
- Finally, connect the enriched data to the “Gradio Dashboard” (gradio-dashboard.py) which interacts with the user.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Data Source and Configuration
    A["Kaggle Book Data"]:::external
    B["OpenAI API (via .env/README.md)"]:::external

    %% Processing Modules
    subgraph "Processing Modules"
        D["Data Cleaning & Exploration (data-exploration.ipynb)"]:::backend
        E["Vectorization & Semantic Search (vector-search.ipynb)"]:::backend
        F["Zero-Shot Text Classification (text-classification.ipynb)"]:::backend
        G["Sentiment Analysis (sentiment-analysis.ipynb)"]:::backend
        H["Book Enrichment"]:::backend
    end

    %% User Interface
    subgraph "User Interface"
        I["Gradio Dashboard (gradio-dashboard.py)"]:::frontend
    end

    %% Data Flow Connections
    A -->|"raw_data"| D
    D -->|"cleaned_data"| E
    D -->|"cleaned_data"| F
    D -->|"cleaned_data"| G
    E -->|"vector_embeddings"| H
    F -->|"classification_output"| H
    G -->|"sentiment_scores"| H
    B -.->|"API_config"| F
    B -.->|"API_config"| G
    H -->|"enriched_recommendations"| I

    %% Click Events
    click D "https://github.com/abhishek445566/book-recommendation-system/blob/main/data-exploration.ipynb"
    click E "https://github.com/abhishek445566/book-recommendation-system/blob/main/vector-search.ipynb"
    click F "https://github.com/abhishek445566/book-recommendation-system/blob/main/text-classification.ipynb"
    click G "https://github.com/abhishek445566/book-recommendation-system/blob/main/sentiment-analysis.ipynb"
    click I "https://github.com/abhishek445566/book-recommendation-system/blob/main/gradio-dashboard.py"
    click B "https://github.com/abhishek445566/book-recommendation-system/blob/main/README.md"

    %% Styling
    classDef external fill:#F9E79F,stroke:#D35400,stroke-width:2px;
    classDef backend fill:#D6EAF8,stroke:#1B4F72,stroke-width:2px;
    classDef frontend fill:#FADBD8,stroke:#922B21,stroke-width:2px;
```
