# eosphoros-ai/awesome-text2sql architecture

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

- Interactive diagram: https://gitdiagram.com/eosphoros-ai/awesome-text2sql
- Repository: https://github.com/eosphoros-ai/awesome-text2sql

## Overview

##### Main Components

a) Core Text2SQL Pipeline:
- Natural Language Input Layer
- Schema Understanding Component
- SQL Generation Engine
- Execution & Validation Layer
- Output Layer (SQL Query/Results)

b) Supporting Components:
- Model Architecture Section
- Base Models (LLaMA, ChatGLM, etc.)
- Fine-tuning Methods (P-Tuning, LoRA, etc.)
- Evaluation Metrics (EX, EM)

c) Dataset Integration:
- Training Datasets (Spider, WikiSQL, etc.)
- Evaluation Datasets (BIRD, etc.)
- Data Flow Paths

##### Relationship Visualization

- Data flow (→): How information moves through the system
- Dependencies (⇢): Which components rely on others
- Integration points (⇄): Where components interact

##### Component Organization

Top Level:
**[Natural Language Input] → [Processing Pipeline] → [SQL Output]**

Middle Level:
**[Base Models] ↔ [Fine-tuning Methods] → [Trained Model]**

Bottom Level:
**[Datasets] → [Training/Evaluation] → [Performance Metrics]**

##### Additional Details

- Supported model architectures
- Fine-tuning approaches
- Evaluation metrics
- Dataset characteristics

##### Notes

- Keep the main flow clear and centered
- Use consistent spacing and alignment
- Version information
- Brief descriptions for complex components

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        NLI[Natural Language Input]
    end

    subgraph Processing_Pipeline
        SU[Schema Understanding]
        SG[SQL Generation Engine]
        EV[Execution & Validation]
    end

    subgraph Output
        SO[SQL Output]
        RES[Results]
    end

    subgraph Model_Components
        BM[Base Models]
        FT[Fine-tuning Methods]
        TM[Trained Model]
    end

    subgraph Datasets
        TD[(Training Datasets)]
        ED[(Evaluation Datasets)]
    end

    subgraph Transformations
        T2A[Text2API]:::api
        T2D[Text2DSL]:::dsl
        T2V[Text2Vis]:::vis
    end

    subgraph Documentation
        DOC[Documentation]:::doc
        CG[Contribution Guidelines]:::doc
    end

    %% Main Flow
    NLI --> SU
    SU --> SG
    SG --> EV
    EV --> SO
    SO --> RES

    %% Model Integration
    BM --> FT
    FT --> TM
    TM --> SG

    %% Dataset Flow
    TD --> TM
    ED --> EV

    %% Transformation Components
    T2A --> SG
    T2D --> SG
    T2V --> RES

    %% Documentation Links
    DOC -.-> T2A
    DOC -.-> T2D
    DOC -.-> T2V
    CG -.-> DOC

    %% Styling
    classDef default fill:#ddd,stroke:#333,stroke-width:1px
    classDef api fill:#f9f,stroke:#333
    classDef dsl fill:#ff9,stroke:#333
    classDef vis fill:#9f9,stroke:#333
    classDef doc fill:#99f,stroke:#333

    %% Click Events
    click DOC "https://github.com/eosphoros-ai/Awesome-Text2SQL/blob/main/README.md"
    click T2A "https://github.com/eosphoros-ai/Awesome-Text2SQL/blob/main/Text2API.md"
    click T2D "https://github.com/eosphoros-ai/Awesome-Text2SQL/blob/main/Text2DSL.md"
    click T2V "https://github.com/eosphoros-ai/Awesome-Text2SQL/blob/main/Text2Vis.md"
    click CG "https://github.com/eosphoros-ai/Awesome-Text2SQL/blob/main/CONTRIBUTING.md"

    %% Legend
    subgraph Legend
        L1[Process]
        L2[(Database)]
        L3[Documentation]:::doc
        L4[API Component]:::api
        L5[DSL Component]:::dsl
        L6[Visualization]:::vis
    end
```
