feat: offline pronunciation pipeline with NeMo CTC + GOP scoring#20
Open
fasuizu-br wants to merge 1 commit intosilvioprog:mainfrom
Open
feat: offline pronunciation pipeline with NeMo CTC + GOP scoring#20fasuizu-br wants to merge 1 commit intosilvioprog:mainfrom
fasuizu-br wants to merge 1 commit intosilvioprog:mainfrom
Conversation
Replace Web Speech API approach with a fully offline, privacy-first pronunciation evaluation system using NeMo Conformer CTC Small (INT4, 17.1MB) running via ONNX Runtime Web. Key features: - Per-phoneme GOP scoring with Viterbi forced alignment - L1-aware Brazilian Portuguese accent adaptation (21 phonemes, 3 tiers) - Decoded transcript verification with 1.5x boost for confirmed BR patterns - 100% offline, 100% private — no audio leaves the device - Cross-browser: Chrome, Firefox, Safari (including iOS) Technical details: - Model: NeMo Conformer CTC Small INT4 (17.1MB, 61% smaller than FP32) - WER: 2.9% native, 17.8% BR accent (does NOT auto-correct speech) - Pipeline: AudioWorklet → WebWorker → ONNX inference → Viterbi → GOP - 155 unit tests passing Validated with real audio from Speech Accent Archive (George Mason Univ): - 12 Brazilian speakers + 6 native Americans - 50% BR-to-native gap recovered by L1 scoring - Statistical significance: p=0.0017, Cohen's d=1.28
28e8dc4 to
f823235
Compare
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.
Summary
Technical details
Pipeline
L1 Scoring Tiers (Brazilian Portuguese)
Real Audio Validation (Speech Accent Archive, George Mason University)
Files changed
src/lib/speechUtils.ts— CTC processing, Viterbi alignment, GOP scoring, L1 adaptationsrc/workers/stt-worker.ts— WebWorker for ONNX inferencesrc/hooks/useSpeechRecognition.ts— React hook (audio capture + worker communication)src/components/Study/SpeakingPractice.tsx— UI with per-phoneme colored feedbacksrc/lib/types.ts— TypeScript types for pronunciation resultspublic/models/— INT4 ONNX model (17.1MB) + token vocabularyTest plan
npm run buildpasses cleanlynpx vitest run— 155 tests passing