feat: add CTC greedy/beam search decoding with ARPA language model support#384
Open
JarbasAl wants to merge 3 commits intoFluidInference:mainfrom
Open
feat: add CTC greedy/beam search decoding with ARPA language model support#384JarbasAl wants to merge 3 commits intoFluidInference:mainfrom
JarbasAl wants to merge 3 commits intoFluidInference:mainfrom
Conversation
…pport Adds standalone CTC decoding utilities that work with CTC log-probabilities: - ctcGreedyDecode: argmax per timestep with repeat collapse - ctcBeamSearch: prefix beam search with optional ARPA LM rescoring - ARPALanguageModel: loads unigram/bigram ARPA files for beam search Both decoders accept [[Float]] (from CtcKeywordSpotter) and MLMultiArray (from direct CoreML inference) inputs.
30 tests covering: - logAddExp math utilities (5 tests) - decodeCtcTokenIds token decoding (4 tests) - CTC greedy decode with [[Float]] and MLMultiArray (6 tests) - CtcBeam struct properties (4 tests) - CTC beam search without/with MLMultiArray (4 tests) - ARPA LM loading, unigram/bigram parsing, scoring (7 tests) - Beam search with LM overriding acoustic score (1 test)
- Move \end\ check inside hasPrefix("\\") block so it's reachable
- Replace nested if with flat conditional in beam search LM scoring
- Add whitespace trimming to ARPALineReader EOF path
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.
Adds standalone CTC decoding utilities that work with CTC log-probabilities:
Both decoders accept [[Float]] (from CtcKeywordSpotter) and MLMultiArray (from direct CoreML inference) inputs.
Why is this change needed?
Reduce WER with domain specific language models
AI Disclosure
I never worked with swift before, Claude Opus did most of the work