MMS<T>

Models & Types · AiDotNet.SpeechRecognition.Multilingual

MMS: Massively Multilingual Speech covering 1100+ languages

Inheritance: NeuralNetworkBase<T> → AudioNeuralNetworkBase<T> → MMS<T>

Implements: ISpeechRecognizer<T>

For Beginners

MMS (Massively Multilingual Speech) extends wav2vec 2.0 to 1100+ languages using religious text recordings and other multilingual data sources. The model uses a shared Transformer encoder pre-trained on unlabeled speech from 1400+ languages, then …

How It Works

References:

  • Paper: “Scaling Speech Technology to 1,000+ Languages” (Pratap et al., Meta, 2023)

MMS (Massively Multilingual Speech) extends wav2vec 2.0 to 1100+ languages using religious text recordings and other multilingual data sources. The model uses a shared Transformer encoder pre-trained on unlabeled speech from 1400+ languages, then fine-tuned with CTC on labeled data. Language-specific adapter layers enable efficient multi-language support without full model duplication. Achieves strong ASR for many low-resource languages previously unsupported.

Example

// Create an MMS model for massively multilingual ASR (1100+ languages)
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.OneDimensional,
    taskType: NeuralNetworkTaskType.SpeechRecognition,
    inputHeight: 16000, inputWidth: 1, inputDepth: 1, outputSize: 5000);
var model = new MMS<double>(architecture);
            
// Or load a pre-trained ONNX model for low-resource language ASR
var onnxModel = new MMS<double>(architecture, "mms.onnx");

Constructors

Constructor Summary
MMS(NeuralNetworkArchitecture<T> architecture, MMSOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer)
MMS(NeuralNetworkArchitecture<T> architecture, string modelPath, MMSOptions 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 using MMS’s multilingual SSL encoder with CTC.
string DetectLanguage(Tensor<T> audio)
void LoadTorchWeights(Func<string, int[], double[]> read) Loads a transformers *ForCTC state dict straight from source.