# akshit-1729/ie-gr architecture

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

- Interactive diagram: https://gitdiagram.com/akshit-1729/ie-gr
- Repository: https://github.com/akshit-1729/ie-gr

## Overview

##### Flow and Relationships

a. Primary Flow:
- Dictionary Data → JSON Generation → PDF Generation → Information Extraction

b. Secondary Flows:
- JSON Files → JSON Splitter → Standardization
- PDF Reports → Vision AI → Structured Data

##### Component Details

Following details to each component:

a. Data Generation Components:
- Input/Output formats
- Key libraries used (Faker, ReportLab)
- Processing steps

b. Processing Components:
- Transformation rules
- AI model integration points
- Validation steps

##### External Dependencies (Purple hexagons)
- OpenAI GPT-4 Vision API
- Python Libraries
- File System

- Dictionary files
- Generated JSONs
- PDF reports
- Standardized output

##### Key Features to Highlight

- Synthetic data generation capabilities
- PDF processing workflow
- AI-powered extraction
- Standardization rules

##### Subsystems

Related components into subsystems:
- Data Generation Subsystem
- Processing Subsystem
- Storage Subsystem
- AI Integration Subsystem

##### Technical Details

Annotations for:
- File formats (JSON, PDF, TXT)
- Key libraries (ReportLab, OpenAI, pdf2image)
- Data transformation steps
- Validation points

Remember to include version information and any relevant notes about scalability or future enhancements as mentioned in the README.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Processing Component]:::processing
        L2[(Storage Component)]:::storage
        L3{{External Service}}:::external
        L4[/Input/Output/]:::io
    end

    subgraph "Data Generation Layer"
        JSON_GEN[JSON Generator]:::processing
        PDF_GEN[PDF Report Generator]:::processing
        SYNTH[Synthetic Data Orchestrator]:::processing
    end

    subgraph "Data Processing Layer"
        JSON_SPLIT[JSON Splitter]:::processing
        DATA_STD[Data Standardizer]:::processing
        INFO_EXT[Information Extractor]:::processing
    end

    subgraph "Storage Layer"
        DICT_STORE[(Dictionary Storage)]:::storage
        JSON_STORE[(Generated JSON Storage)]:::storage
        PDF_STORE[(PDF Report Storage)]:::storage
        STD_STORE[(Standardized Format Storage)]:::storage
    end

    subgraph "External Dependencies"
        GPT4{{OpenAI GPT-4 Vision API}}:::external
        PYLIBS{{Python Libraries}}:::external
        FS{{File System}}:::external
    end

    %% Data Flow
    DICT_STORE --> JSON_GEN
    JSON_GEN --> JSON_STORE
    JSON_STORE --> PDF_GEN
    PDF_GEN --> PDF_STORE
    PDF_STORE --> INFO_EXT
    JSON_STORE --> JSON_SPLIT
    JSON_SPLIT --> DATA_STD
    DATA_STD --> STD_STORE
    INFO_EXT --> STD_STORE

    %% External Dependencies
    PYLIBS --> JSON_GEN
    PYLIBS --> PDF_GEN
    GPT4 --> INFO_EXT
    FS --> DICT_STORE
    FS --> JSON_STORE
    FS --> PDF_STORE
    FS --> STD_STORE

    %% Orchestration
    SYNTH --> JSON_GEN
    SYNTH --> PDF_GEN

    %% Styling
    classDef processing fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef storage fill:#ffe6a8,stroke:#333,stroke-width:2px
    classDef external fill:#e6a8ff,stroke:#333,stroke-width:2px
    classDef io fill:#a8ffd1,stroke:#333,stroke-width:2px

    %% Click Events
    click JSON_GEN "https://github.com/akshit-1729/IE-GR/blob/main/DATASET/generate_json.py"
    click PDF_GEN "https://github.com/akshit-1729/IE-GR/blob/main/DATASET/reportlab_doc.py"
    click SYNTH "https://github.com/akshit-1729/IE-GR/blob/main/DATASET/generate_data.py"
    click JSON_SPLIT "https://github.com/akshit-1729/IE-GR/blob/main/DATASET/split_json.py"
    click DATA_STD "https://github.com/akshit-1729/IE-GR/blob/main/DATASET/to_std_format.py"
    click DICT_STORE "https://github.com/akshit-1729/IE-GR/tree/main/DATASET/Dictionaries"
    click JSON_STORE "https://github.com/akshit-1729/IE-GR/tree/main/DATASET/synthetic_data"
    click STD_STORE "https://github.com/akshit-1729/IE-GR/tree/main/DATASET/formatted ground truth"
```
