← PROVA‑MG overview
Back matter  /  Annexes

Annexes

Eight appendices that document the engineering substrate of the present thesis: local project organization, repository, source code arborescence, launch commands, simulation and production execution, web interface, and execution journal.

Annexe A

A. Local project organization in VS Code

The local project organization mirrors the modular structure of the methodology. The Visual Studio Code workspace contains five top‑level folders, each corresponding to one segment of the workflow. data/ holds the partitioned manifests for Tier‑A, Tier‑B, Tier‑C, and Tier‑D corpora; raw audio is stored on external object storage and referenced by URI from within the manifests. models/ holds the local model registry; foundation checkpoints are referenced as Hugging Face IDs in a JSON index. src/ holds the Python source tree, organized by component (3.1 routing, 3.2 typology, 3.3 EM loop, 3.4 latent inference, 3.5 calibration). experiments/ holds configuration files (YAML) and result manifests (JSONL). docs/ holds the manuscript sources, the model cards, and the datasheets. A .devcontainer/ directory provides a reproducible Docker development image; the IDE attaches to the running container so that the host system is not modified. Linting, type checking, and unit tests run on save through configured tasks.

Annexe B

B. Private GitHub repository

The source code, the manifests, the experiment configurations, and the manuscript sources are kept in a private GitHub repository at https://github.com/<org>/prova‑mg (URL to be substituted on publication). Access is governed by an explicit collaborator list, recorded in the repository's README. A mirror to an institutional GitLab instance is maintained for continuity. On final defense, a public mirror is created and the artifacts are simultaneously archived on Zenodo with a persistent DOI; the private repository is preserved for change history but is no longer the canonical reference.

Annexe C

C. Source code arborescence

The Python source tree follows a component‑oriented layout. Each component of Chapter III has its own sub‑package; shared utilities (data loading, evaluation, training loops) sit in a separate common/ package. The structure is reproduced below in abbreviated form.

prova-mg/
│
├─ data/
│  ├─ manifests/
│  │  ├─ tier_a.jsonl
│  │  ├─ tier_b.jsonl
│  │  ├─ tier_c.jsonl
│  │  └─ tier_d.jsonl
│  └─ manifests_test/
│     ├─ fleurs_mg.jsonl
│     ├─ cv_mg.jsonl
│     └─ in_domain.jsonl
├─ src/
│  ├─ common/
│  │  ├─ data_loader.py
│  │  ├─ evaluation.py
│  │  ├─ training.py
│  │  └─ utils.py
│  ├─ c31_routing/
│  │  ├─ teachers.py
│  │  ├─ features.py
│  │  └─ router.py
│  ├─ c32_typology/
│  │  ├─ train_typ_lm.py
│  │  └─ decode_with_prior.py
│  ├─ c33_em/
│  │  ├─ e_step.py
│  │  ├─ m_step.py
│  │  └─ constraints.py
│  ├─ c34_latent/
│  │  ├─ graphical_model.py
│  │  └─ mean_field.py
│  └─ c35_calibration/
│     ├─ features.py
│     └─ fit_calibrator.py
├─ experiments/
│  ├─ configs/
│  └─ results/
├─ tests/
└─ docs/
   ├─ manuscript/
   ├─ model_cards/
   └─ datasheets/
Annexe D

D. Launch commands

The repository's README.md documents the canonical launch commands for each stage of the workflow. The commands are reproduced below in abbreviated form; the full file in the repository contains environment activation, distributed‑launch wrappers, and resume‑from‑checkpoint flags.

README.md (abbreviated) # Environment $ docker compose up -d devcontainer $ docker exec -it prova-mg-dev bash # Stage 1 - initialization $ python -m src.common.training --config experiments/configs/init_sup.yaml # Stage 2 - teacher inference on Tier C $ python -m src.c31_routing.teachers --teachers all --split tier_c # Stage 3 - calibration and routing fit $ python -m src.c35_calibration.fit_calibrator --config experiments/configs/calib.yaml $ python -m src.c31_routing.router --config experiments/configs/router.yaml # Stage 4 - constrained EM loop $ python -m src.c33_em.run --config experiments/configs/em_full.yaml --iterations 6 # Stage 5 - joint latent inference and final eval $ python -m src.c34_latent.mean_field --config experiments/configs/latent.yaml $ python -m src.common.evaluation --splits fleurs_mg cv_mg in_domain
Annexe E

E. Execution in simulation mode

For methodological work prior to a full corpus run, a simulation mode is provided. In simulation mode, the unlabeled pool is replaced by a synthetic stream generated from the supervised set by controlled corruption (additive noise, time warping, partial label removal), and the teacher posteriors are emulated by an analytic mixture whose disagreement profile is parameterized. The simulation mode is built on a SimPy‑like discrete‑event harness and allows the validation of the constrained EM loop independently of compute‑heavy teacher inference. A typical simulation log is reproduced below.

simulation.log (excerpt) [t=0.000] init theta from supervised (N=14 320 segments) [t=0.001] sim unlabeled stream size=120 000 disagreement_profile=tri-modal [t=0.014] EM iter 1 E-step: 87.3% segments admitted under C1 C2 C3 C4 [t=0.052] EM iter 1 M-step: held-out WER 31.4 -> 28.9 [t=0.066] EM iter 2 E-step: 88.1% segments admitted [t=0.108] EM iter 2 M-step: held-out WER 28.9 -> 27.0 [t=0.121] EM iter 3 E-step: 88.6% segments admitted [t=0.165] EM iter 3 M-step: held-out WER 27.0 -> 26.2 [t=0.166] EM iter 3 KL drift 0.018 < epsilon=0.05 OK [t=0.220] convergence reached (delta < 0.5 WER)
Annexe F

F. Execution in production mode

The production mode runs the same code path on the actual Tier‑A through Tier‑C corpora and on the registered foundation models. A typical production log records GPU hours, dataset sizes, and per‑iteration WER on the held‑out development set. Logs are stored under experiments/results/<run_id>/ and indexed by Weights & Biases.

production.log (excerpt) [2026-04-08 09:12] run_id=prv-2026-04-08-em-full user=randriamanasina [2026-04-08 09:12] hardware: 4x A100-80GB bf16 effective batch=64 [2026-04-08 09:13] stage 1 init D_sup=312h D_dev=8h [2026-04-08 14:47] stage 2 teacher inference complete D_unsup=12 480h GPU-h=174 [2026-04-08 16:02] stage 3 calibration fit ECE_raw=0.182 ECE_cal=0.041 [2026-04-08 16:18] stage 4 EM iter 1 start [2026-04-09 02:11] stage 4 EM iter 1 complete dev-WER 24.7 -> 22.1 [2026-04-09 11:55] stage 4 EM iter 2 complete dev-WER 22.1 -> 20.6 ... [output truncated for brevity] ... [2026-04-12 06:22] stage 5 final eval fleurs_mg=14.3 cv_mg=19.8 in_domain=22.9
Annexe G

G. Web interface

A small web interface, served from a FastAPI back‑end and a Svelte front‑end, exposes the final model for interactive testing. The interface accepts a recorded or uploaded audio segment, displays the top‑1 transcript together with the calibrated confidence and the per‑teacher transcripts, shows the inferred dialect and register, and highlights segments tagged as code‑switched. A screenshot, reproduced in the printed thesis, displays the layout: a recording widget at the top, the consensus transcription in the centre with confidence‑coloured highlighting, the three teacher transcripts side by side below, and a metadata bar at the bottom reporting dialect, register, code‑switching density, and a link to the segment‑level posterior visualization. The interface is intended primarily for qualitative diagnostic rather than for production deployment.

Annexe H

H. Execution journal

A daily execution journal is kept throughout the doctoral period as a tab‑separated text file under version control. Each entry records the date, the active stage of the workflow, the run identifiers launched, the experiment configurations modified, the issues encountered, and the resolution. An excerpt is reproduced below for illustration.

journal.tsv (excerpt) 2026-03-02 P1 data_v1 tier-A intake check completed for 38h 2026-03-05 P1 data_v1 IAA report: CER 4.1% on double-annotated subset 2026-03-12 P0 baselines whisper-large-v3 zero-shot reproduced (WER 47.3 on fleurs-mg) 2026-03-21 P2 routing feature pipeline finalized; router trained, dev acc 0.81 2026-04-02 P3 calibration isotonic regression preferred over temperature scaling 2026-04-08 P5 em-loop run prv-2026-04-08-em-full launched (see Annex F) 2026-04-13 P6 latent mean-field convergence verified on dev set ... [redacted entries] ... 2026-05-04 P7 full system master ablation table generated for thesis