CTCDecoderOptions
Options & Configuration · AiDotNet.Audio.SpeechRecognition
Configuration options for the CTC Decoder speech recognition model.
Inheritance: ModelOptions → CTCDecoderOptions
For Beginners
CTC decoding solves a fundamental problem: audio frames don’t neatly align with letters or words. Some frames correspond to silence, some to the middle of a vowel, and the model must figure out which frames correspond to which characters. CTC introduces a “blank” token that the model outputs when nothing new is being said, then the decoder collapses repeated characters and removes blanks.
Example of CTC decoding: Raw output: h h - e e - l - l - l - o o After collapse: h e l l o (where - is the blank token)
How It Works
CTC (Connectionist Temporal Classification, Graves et al., 2006) is a training criterion and decoding algorithm that allows sequence-to-sequence mapping without requiring exact input-output alignment. With a greedy or beam-search decoder, CTC-trained models directly output transcriptions from encoder features. CTC is used by wav2vec 2.0, Conformer-CTC, DeepSpeech 2, and many production ASR systems.
Constructors
| Constructor | Summary |
|---|---|
CTCDecoderOptions() |
Properties
| Property | Summary |
|---|---|
OnnxModelOptions OnnxOptions { get; set; } |
Gets or sets the ONNX runtime options. |
bool UseLM { get; set; } |
Gets or sets whether to use a language model for rescoring. |
double DropoutRate { get; set; } |
Gets or sets the dropout rate. |
double LMWeight { get; set; } |
Gets or sets the language model weight for beam search. |
double LearningRate { get; set; } |
Gets or sets the learning rate. |
double WordInsertionPenalty { get; set; } |
Gets or sets the word insertion penalty for beam search. |
int BeamWidth { get; set; } |
Gets or sets the CTC beam width for beam search decoding. |
int BlankTokenIndex { get; set; } |
Gets or sets the blank token index in the vocabulary. |
int EncoderDim { get; set; } |
Gets or sets the encoder hidden dimension. |
int FeedForwardDim { get; set; } |
Gets or sets the feed-forward dimension. |
int MaxAudioLengthSeconds { get; set; } |
Gets or sets the maximum audio length in seconds. |
int NumAttentionHeads { get; set; } |
Gets or sets the number of attention heads. |
int NumEncoderLayers { get; set; } |
Gets or sets the number of encoder layers. |
int NumMels { get; set; } |
Gets or sets the number of mel-spectrogram frequency bins. |
int SampleRate { get; set; } |
Gets or sets the expected audio sample rate in Hz. |
int VocabSize { get; set; } |
Gets or sets the vocabulary size. |
string Language { get; set; } |
Gets or sets the default language code. |
string ModelPath { get; set; } |
Gets or sets the path to the ONNX model file. |
string Variant { get; set; } |
Gets or sets the model variant (“small”, “medium”, “large”). |
string[] Vocabulary { get; set; } |
Gets or sets the CTC vocabulary (characters or BPE tokens). |