ParaformerOptions

Options & Configuration · AiDotNet.SpeechRecognition.AlibabaASR

Options for Paraformer: fast and accurate parallel Transformer for non-autoregressive ASR.

Inheritance: ModelOptions → ParaformerOptions

For Beginners

These options configure the Paraformer model. Defaults are FunASR’s AISHELL-1 Paraformer recipe: a 12-block Conformer encoder of width 256, a 6-block parallel decoder, CTC weight 0.3, label smoothing 0.1 and glancing ratio 0.4.

Constructors

Constructor Summary
ParaformerOptions() Initializes a new instance with default values.
ParaformerOptions(ParaformerOptions other) Initializes a new instance by copying from another instance.

Properties

Property Summary
OnnxModelOptions OnnxOptions { get; set; } Gets or sets the ONNX Runtime settings used when the model is loaded from an ONNX file.
double CtcWeight { get; set; } The encoder CTC loss’s weight (0.3).
double LabelSmoothing { get; set; } The decoder loss’s label smoothing (0.1).
double PredictorWeight { get; set; } The MAE token-count loss’s weight (1).
double SamplingRatio { get; set; } The glancing sampler’s λ (0.4).
double TailThreshold { get; set; } The CIF tail weight at inference (0.45).
double TimeMaskRatio { get; set; }
int ConvKernel { get; set; } The Conformer convolution module’s kernel (15).
int EncoderDim { get; set; } The encoder’s width (256), which the predictor and the decoder share.
int FeedForwardDim { get; set; } The encoder’s and decoder’s feed-forward width (2048), a multiple of EncoderDim.
int FrequencyMaskWidth { get; set; }
int FrequencyMasks { get; set; } SpecAugment frequency masks (2) of up to FrequencyMaskWidth bins (30).
int MaxAudioLengthSeconds { get; set; } Gets or sets the longest clip, in seconds, of the reference configuration.
int MaxTextLength { get; set; } Gets or sets the most tokens decoded for one utterance.
int NumAttentionHeads { get; set; } Gets or sets the number of attention heads.
int NumDecoderLayers { get; set; } Parallel SAN decoder blocks (6).
int NumEncoderLayers { get; set; } Conformer encoder blocks (12).
int NumMels { get; set; } Gets or sets the number of mel-frequency bands.
int SampleRate { get; set; } Gets or sets the sample rate, in Hz, that input audio is expected at.
int TimeMasks { get; set; } SpecAugment time masks (2), each up to TimeMaskRatio of the utterance.
int VocabSize { get; set; } Output vocabulary, blank (0), start (1) and end (2) included.
int WarmupSteps { get; set; } The learning rate’s warmup steps (30,000, FunASR’s warmuplr).
string Language { get; set; } Gets or sets the language code used for speech processing.
string ModelPath { get; set; } Gets or sets the path of the pretrained ONNX model.
string[] Vocabulary { get; set; } Optional vocabulary mapping token IDs to text tokens (e.g., SentencePiece vocabulary).