SpeechmaticsASR<T>
Models & Types · AiDotNet.SpeechRecognition.ProprietaryAPI
A Speechmatics stand-in after Ursa’s disclosed design: an efficient Transformer encoder whose acoustic model gives phoneme probabilities, here a Conformer with a CTC layer over phonemes.
Inheritance: NeuralNetworkBase<T> → AudioNeuralNetworkBase<T> → SpeechmaticsASR<T>
Implements: ISpeechRecognizer<T>
For Beginners
This model turns 16 kHz audio into an 80-band log-mel spectrogram, shortens it 4x with two convolutions and encodes it with Conformer blocks. A linear layer gives every frame a probability for each phoneme; collapsing repeats and blanks gives the phoneme sequence.
How It Works
This is a stand-in, not Speechmatics’ production model. Speechmatics has disclosed that Ursa is a self-supervised “body model” (an efficient Transformer variant, about 2 billion parameters) trained on unlabeled audio, followed by an acoustic model trained on transcribed audio that maps its representations to phoneme probabilities, with a language model turning phonemes into words. Layer counts and widths are not published. The stand-in keeps the disclosed shape at trainable size: a Conformer encoder (Gulati et al. 2020) in place of the efficient Transformer, 18 blocks of width 512 with 8 heads and a 31-wide kernel, and a CTC layer (Graves et al. 2006) over the 39 ARPAbet phonemes and a word boundary. The self-supervised pre-training, the lexicon and the language model are not modelled, so transcriptions are phoneme strings. The paper’s blocks use relative positional encoding; these use rotary position encoding.
Example
var architecture = new NeuralNetworkArchitecture<float>(
inputType: InputType.OneDimensional,
taskType: NeuralNetworkTaskType.SpeechRecognition,
inputSize: 16000, outputSize: 34);
var model = new SpeechmaticsASR<float>(architecture);
var text = model.Transcribe(waveform).Text;
Constructors
| Constructor | Summary |
|---|---|
SpeechmaticsASR(NeuralNetworkArchitecture<T> architecture, SpeechmaticsASROptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) |
|
SpeechmaticsASR(NeuralNetworkArchitecture<T> architecture, string modelPath, SpeechmaticsASROptions options) |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<string> SupportedLanguages { get; } |
|
bool SupportsStreaming { get; } |
|
bool SupportsWordTimestamps { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyDictionary<string, T> DetectLanguageProbabilities(Tensor<T> audio) |
|
IStreamingTranscriptionSession<T> StartStreamingSession(string language) |
|
ModelMetadata<T> GetModelMetadata() |
|
Task<TranscriptionResult<T>> TranscribeAsync(Tensor<T> audio, string language, bool? includeTimestamps, CancellationToken cancellationToken) |
|
Tensor<T> ForwardForTraining(Tensor<T> input) |
|
TranscriptionResult<T> Transcribe(Tensor<T> audio, string language, bool? includeTimestamps) |
Transcribes audio: the encoder and the CTC layer with greedy decoding. |
string DetectLanguage(Tensor<T> audio) |