# ai4bharat/indicvoices architecture

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

- Interactive diagram: https://gitdiagram.com/ai4bharat/indicvoices
- Repository: https://github.com/ai4bharat/indicvoices

## Overview

- Audio Collection → Audio Processing
- Audio Processing → Chunking
- Chunking → Manifest Generation

- Raw Audio → Downsampling (16kHz)
- Text → Tokenization
- Processed Data → Model Training

- Training Data → Model
- Model → Inference
- Inference → Transcription Output

##### Integration Points

a. External Systems
- Wandb Integration
- GPU Infrastructure
- Storage Systems

b. Tools Integration
- FFmpeg for Audio Processing
- Python Scripts
- Shell Scripts

Use the following visual elements:
- Rounded rectangles for processes
- Clear labels and annotations

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph DC["Data Collection Layer"]
        KP[Kathbath Platform]
        KF[Karya Framework]
        AC[Audio Collection]
    end

    subgraph DP["Data Processing Layer"]
        APP["Audio Processing Pipeline"]:::script
        CS["Chunking System"]
        MGS["Manifest Generation System"]:::script
        TS["Tokenization System"]:::script
    end

    subgraph TL["Transcription Layer"]
        SP[Shoonya Platform]
        QC[Quality Control]
        TT[Transcription Tools]
        AS[Annotation System]
    end

    subgraph ML["Model Layer"]
        IM[IndicASR Model]
        TP[Training Pipeline]
        IP[Inference Pipeline]
        MC["Model Configuration"]:::config
    end

    %% Storage Components
    subgraph ST["Storage"]
        direction TB
        DS[(Dataset Storage)]
        subgraph AR["Artifacts"]
            direction TB
            DICT["Dictionaries"]:::artifacts
            TOK["Tokenizers"]:::artifacts
            TR["Text Resources"]:::artifacts
            CP[(Model Checkpoints)]
        end
    end

    %% Tools and Utilities
    subgraph UT["Utilities"]
        direction TB
        DCT["Dataset Creation Tools"]:::script
        DClT["Data Cleaning Tools"]:::script
        CDT["Custom Data Transformations"]:::script
        TT["Testing Tools"]:::script
        TR["Tokenizer Refinement"]:::script
    end

    %% Data Flow
    KP --> APP
    KF --> APP
    AC --> APP
    APP --> CS
    CS --> MGS
    MGS --> DS
    DS --> TS
    TS --> TP
    DS --> TP
    TP --> IM
    IM --> IP
    IP --> SP

    %% Quality Control Flow
    TT --> QC
    AS --> QC
    QC --> DS

    %% Artifact Usage
    DICT --> TS
    TOK --> TS
    TR --> TP
    TP --> CP

    %% Click Events
    click APP "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_dataset_process.sh"
    click MGS "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_dataset_create_manifest.sh"
    click TS "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_tokenizer_create.sh"
    click DICT "https://github.com/AI4Bharat/IndicVoices/tree/master/artifacts/dictionaries/"
    click TOK "https://github.com/AI4Bharat/IndicVoices/tree/master/artifacts/tokenizers/"
    click TR "https://github.com/AI4Bharat/IndicVoices/tree/master/artifacts/text-resources/"
    click MC "https://github.com/AI4Bharat/IndicVoices/blob/master/config/hybrid_indicvoices.yaml"
    click DCT "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_dataset_create_iv.py"
    click DClT "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_dataset_clean.py"
    click CDT "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_dataset_custom_transforms.py"
    click TT "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_dataset_create_manifest_test.sh"
    click TR "https://github.com/AI4Bharat/IndicVoices/blob/master/data_prep_scripts/utils_tokenizer_refine_doc.py"

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef script fill:#d4e6ff,stroke:#333
    classDef artifacts fill:#ffe6cc,stroke:#333
    classDef config fill:#e6ffe6,stroke:#333

    %% Legend
    subgraph Legend
        L1[Process]:::default
        L2[Script]:::script
        L3[Artifact]:::artifacts
        L4[Config]:::config
    end
```
