# ashwinhegde19/mendspeech architecture

> Architecture diagram of the GitHub repository ashwinhegde19/mendspeech, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashwinhegde19/mendspeech
- Repository: https://github.com/ashwinhegde19/mendspeech

## Overview

MendSpeech is an early-build dictation and speech-robustness project. Its demonstrated workflow loads and damages benchmark audio for comparison; the recognition and scoring modules provide a foundation for evaluating transcripts and confidence. SpeechDamageBench is also a standalone robustness suite. Streaming, triage, editing, post-training, and serving are documented product capabilities but are planned, not represented by source files in the tree. Connections are limited to excerpts, SOURCE INDEX references, and explicit README statements.

Main entry points: [`app/audio_lab.py`](https://github.com/ashwinhegde19/mendspeech/blob/main/app/audio_lab.py) (Audio comparison lab), [`src/asr/baseline.py`](https://github.com/ashwinhegde19/mendspeech/blob/main/src/asr/baseline.py) (Wav2Vec2 baseline), [`src/audio/features.py`](https://github.com/ashwinhegde19/mendspeech/blob/main/src/audio/features.py) (Log-Mel features), [`speechdamagebench/speechdamagebench/audio_damage.py`](https://github.com/ashwinhegde19/mendspeech/blob/main/speechdamagebench/speechdamagebench/audio_damage.py) (Damage operators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_audio["Audio processing"]
  node_loader["Waveform loader<br/>[loader.py]"]
  node_stft["Spectrogram analysis<br/>[stft.py]"]
  node_features["Log-Mel features<br/>[features.py]"]
end

subgraph group_robustness["Robustness lab"]
  node_audio_lab["Audio comparison lab<br/>[audio_lab.py]"]
  node_damage["Damage operators<br/>[audio_damage.py]"]
  node_presets["Damage presets<br/>[presets.py]"]
  node_manifest["Benchmark manifest<br/>[manifest.csv]"]
end

subgraph group_recognition["Recognition"]
  node_asr["Wav2Vec2 baseline<br/>[baseline.py]"]
  node_ctc["CTC decoding<br/>[ctc_decode.py]"]
  node_confidence["Token confidence<br/>[confidence.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_audio_metrics["Audio pair metrics<br/>[audio_metrics.py]"]
  node_normalization["Text normalization<br/>[normalization.py]"]
  node_wer["WER / CER scoring<br/>[wer.py]"]
  node_slices["Protected-content slices<br/>[slices.py]"]
  node_roles["Benchmark role audit<br/>[roles.py]"]
end

subgraph group_planned["Planned dictation"]
  node_streaming["Streaming recognition"]
  node_triage["Confidence triage"]
  node_editor["Conservative editor"]
  node_posttraining["Editor post-training"]
  node_serving["Async serving"]
end

node_user(("Engineer / evaluator"))

node_user -->|"runs comparison"| node_audio_lab
node_audio_lab -->|"loads benchmark"| node_manifest
node_audio_lab -->|"loads clips"| node_loader
node_audio_lab -->|"applies corruption"| node_damage
node_damage -->|"resolves parameters"| node_presets
node_audio_lab -->|"measures pairs"| node_audio_metrics
node_audio_metrics -->|"computes log-Mel distance"| node_features
node_features -->|"uses transform"| node_stft
node_asr -->|"loads audio"| node_loader
node_asr -.->|"decodes emissions"| node_ctc
node_asr -.->|"provides confidence inputs"| node_confidence
node_normalization -->|"normalizes scoring text"| node_wer
node_wer -->|"shares alignment convention"| node_slices
node_user -.->|"dictates"| node_streaming
node_streaming -.->|"routes by confidence"| node_triage
node_triage -.->|"selects editing"| node_editor
node_editor -.->|"receives bounded training"| node_posttraining
node_streaming -.->|"runs through endpoint"| node_serving

click node_audio_lab "https://github.com/ashwinhegde19/mendspeech/blob/main/app/audio_lab.py"
click node_damage "https://github.com/ashwinhegde19/mendspeech/blob/main/speechdamagebench/speechdamagebench/audio_damage.py"
click node_presets "https://github.com/ashwinhegde19/mendspeech/blob/main/speechdamagebench/speechdamagebench/presets.py"
click node_manifest "https://github.com/ashwinhegde19/mendspeech/blob/main/data/benchmark/manifest.csv"
click node_loader "https://github.com/ashwinhegde19/mendspeech/blob/main/src/audio/loader.py"
click node_stft "https://github.com/ashwinhegde19/mendspeech/blob/main/src/audio/stft.py"
click node_features "https://github.com/ashwinhegde19/mendspeech/blob/main/src/audio/features.py"
click node_audio_metrics "https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/audio_metrics.py"
click node_asr "https://github.com/ashwinhegde19/mendspeech/blob/main/src/asr/baseline.py"
click node_ctc "https://github.com/ashwinhegde19/mendspeech/blob/main/src/asr/ctc_decode.py"
click node_confidence "https://github.com/ashwinhegde19/mendspeech/blob/main/src/asr/confidence.py"
click node_normalization "https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/normalization.py"
click node_wer "https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/wer.py"
click node_slices "https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/slices.py"
click node_roles "https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/roles.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loader,node_stft,node_features toneBlue
class node_audio_lab,node_damage,node_presets,node_manifest toneAmber
class node_asr,node_ctc,node_confidence toneMint
class node_audio_metrics,node_normalization,node_wer,node_slices,node_roles toneRose
class node_streaming,node_triage,node_editor,node_posttraining,node_serving,node_user toneIndigo
```

## Components

### Audio processing

- [Waveform loader](https://github.com/ashwinhegde19/mendspeech/blob/main/src/audio/loader.py): `src/audio/loader.py`
- [Spectrogram analysis](https://github.com/ashwinhegde19/mendspeech/blob/main/src/audio/stft.py): `src/audio/stft.py`
- [Log-Mel features](https://github.com/ashwinhegde19/mendspeech/blob/main/src/audio/features.py): `src/audio/features.py`

### Robustness lab

- [Audio comparison lab](https://github.com/ashwinhegde19/mendspeech/blob/main/app/audio_lab.py): `app/audio_lab.py`
- [Damage operators](https://github.com/ashwinhegde19/mendspeech/blob/main/speechdamagebench/speechdamagebench/audio_damage.py): `speechdamagebench/speechdamagebench/audio_damage.py`
- [Damage presets](https://github.com/ashwinhegde19/mendspeech/blob/main/speechdamagebench/speechdamagebench/presets.py): `speechdamagebench/speechdamagebench/presets.py`
- [Benchmark manifest](https://github.com/ashwinhegde19/mendspeech/blob/main/data/benchmark/manifest.csv): `data/benchmark/manifest.csv`

### Recognition

- [Wav2Vec2 baseline](https://github.com/ashwinhegde19/mendspeech/blob/main/src/asr/baseline.py): `src/asr/baseline.py`
- [CTC decoding](https://github.com/ashwinhegde19/mendspeech/blob/main/src/asr/ctc_decode.py): `src/asr/ctc_decode.py`
- [Token confidence](https://github.com/ashwinhegde19/mendspeech/blob/main/src/asr/confidence.py): `src/asr/confidence.py`

### Evaluation

- [Audio pair metrics](https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/audio_metrics.py): `src/metrics/audio_metrics.py`
- [Text normalization](https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/normalization.py): `src/metrics/normalization.py`
- [WER / CER scoring](https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/wer.py): `src/metrics/wer.py`
- [Protected-content slices](https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/slices.py): `src/metrics/slices.py`
- [Benchmark role audit](https://github.com/ashwinhegde19/mendspeech/blob/main/src/metrics/roles.py): `src/metrics/roles.py`

### Planned dictation

- **Streaming recognition**
- **Confidence triage**
- **Conservative editor**
- **Editor post-training**
- **Async serving**

### Other components

- **Engineer / evaluator**

## Connections

- Engineer / evaluator → Audio comparison lab: runs comparison (evidence: `app/audio_lab.py`)
- Audio comparison lab → Benchmark manifest: loads benchmark (evidence: `app/audio_lab.py`)
- Audio comparison lab → Waveform loader: loads clips (evidence: `app/audio_lab.py`)
- Audio comparison lab → Damage operators: applies corruption (evidence: `app/audio_lab.py`)
- Damage operators → Damage presets: resolves parameters (evidence: `speechdamagebench/speechdamagebench/__init__.py`)
- Audio comparison lab → Audio pair metrics: measures pairs (evidence: `app/audio_lab.py`)
- Audio pair metrics → Log-Mel features: computes log-Mel distance (evidence: `src/metrics/audio_metrics.py`)
- Log-Mel features → Spectrogram analysis: uses transform (evidence: `src/audio/features.py`)
- Wav2Vec2 baseline → Waveform loader: loads audio (evidence: `src/asr/baseline.py`)
- Wav2Vec2 baseline → CTC decoding: decodes emissions
- Wav2Vec2 baseline → Token confidence: provides confidence inputs
- Text normalization → WER / CER scoring: normalizes scoring text (evidence: `src/metrics/wer.py`)
- WER / CER scoring → Protected-content slices: shares alignment convention (evidence: `src/metrics/slices.py`)
- Engineer / evaluator → Streaming recognition: dictates (evidence: `README.md`)
- Streaming recognition → Confidence triage: routes by confidence (evidence: `README.md`)
- Confidence triage → Conservative editor: selects editing (evidence: `README.md`)
- Conservative editor → Editor post-training: receives bounded training (evidence: `README.md`)
- Streaming recognition → Async serving: runs through endpoint (evidence: `README.md`)
