Fix CTC loss implementation and address code quality issues in ML pipeline#78
Merged
jodavis merged 3 commits intodev/jodavis/ADR-50-speech-to-textfrom Feb 5, 2026
Merged
Conversation
Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement speech-to-text training pipeline
Fix CTC loss implementation and address code quality issues in ML pipeline
Feb 4, 2026
jodavis
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addressed 33 code review findings including critical bugs in the speech-to-text training pipeline's CTC loss implementation and multiple code quality issues.
Critical Fixes
CTC blank token index: Corrected calculation from
len(vocab_list) + 1tolen(vocab_list)across training and evaluation scripts. The blank token is at the last index (0-based), not one beyond it.CTC label lengths: Fixed to compute actual sequence lengths by counting non-padding tokens instead of using the full padded length:
Tokenization consistency: Aligned preprocessing between
06_create_vocab_list.py(comma replacement) and07_compute_spectrograms.py(was using regex that removed all punctuation).Code Quality
input_output_pairs,ctc_loss_fnfunction03_add_background_noise.pylist.remove(index)→list.pop(index)in variation generator-> (set | List[Dict])→-> Tuple[set, List[Dict]]generate_samples()to track actual count instead of enumerate indexReproducibility & Security
random.seed(42)before train/val/test split for reproducible data partitioning💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.