MCPcopy Index your code
hub / github.com/OFA-Sys/OFA

github.com/OFA-Sys/OFA @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
8,108 symbols 27,583 edges 853 files 1,798 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MMSpeech: Multi-modal Multi-task Encoder-Decoder Pre-training for speech recognition

    <a href="https://github.com/OFA-Sys/OFA/raw/main/modelscope.md">ModelScope</a>&nbsp | &nbsp<a href="https://arxiv.org/abs/2212.00500">Paper </a>&nbsp

We propose a novel multi-modal multi-task encoder-decoder pre-training framework~(MMSpeech) for Mandarin automatic speech recognition~(ASR), which employs a multi-task learning framework including five self-supervised and supervised tasks with speech and text data. Experiments on AISHELL-1 show that our proposed method achieves state-of-the-art performance, with a more than 40% relative improvement compared with other pre-training methods.

<img src="https://github.com/OFA-Sys/OFA/raw/main/examples/mmspeech.png" width="700" />

Datasets & Checkpoints

Model Model Size Unlabeled Speech Unlabeled Text labeled Pre-Training Fine-Tuning
MMSpeech-Base1 210M AISHELL-2 M6-Corpus AISHELL-1 checkpoint checkpoint
MMSpeech-Base2 210M WenetSpeech M6-Corpus AISHELL-1 checkpoint checkpoint
MMSpeech-Large 609M WenetSpeech M6-Corpus AISHELL-1 checkpoint checkpoint

Results on AISHELL-1

  • Compare MMSpeech-Base1 with the model of the same encoder size and amount of unlabeled speech data.
Model dev (w/o LM) dev (wit LM) test (w/o LM) test (with LM)
w/o pre-training 6.4 5.2 6.8 5.7
Data2Vec 3.8 3.7 4.1 3.9
MMSpeech-Base1 2.4 2.1 2.6 2.3
MMSpeech-Base1 (w/o Fine-Tuning) 2.5 2.3 2.6 2.3
  • Compare MMSpeech-Base2 with the model of the same encoder size and amount of unlabeled speech data.
Model dev (wit LM) test (with LM)
Wav2vec 2.0-Base 4.2 4.7
HuBERT-Base 4.1 4.3
MMSpeech-Base2 2.0 2.1
  • Compare MMSpeech-Large with the model of the same encoder size and amount of unlabeled speech data.
Model dev (wit LM) test (with LM)
Wav2vec 2.0-Large 3.8 4.1
HuBERT-Large 3.1 3.3
MMSpeech-Large 1.6 1.9

Quick start

Installation

Note that we update the fairseq version for mmspeech.

git clone https://github.com/OFA-Sys/OFA
pip install -r requirements.txt

Data preparation

Input files for all tasks include three columns: "speech_id, wav_path, text", delimited by a "\t". - "wav_path" denotes the path for the wav files. - "text" denotes raw text inputs. - "pseduo-codes" can be obtained by following the steps in wav2seq.

Data Task speech_id_col wav_path_col text_col
unlabeled speech data S2C, MSP speech_id wav_path pseduo-codes
unlabeled text data P2T speech_id un-used text
speech-text data S2T speech_id wav_path text

We also provide example config_yaml of input fbank features for your reference in here.

training

cd run_scripts/mmspeech
sh mmspeech_cn_base_stage1.sh
sh mmspeech_cn_base_stage2.sh
sh mmspeech_cn_base_stage3.sh

evaluation

cd run_scripts/mmspeech
sh evaluate_mmspeech_base.sh

Core symbols most depended-on inside this repo

size
called by 792
fairseq/fairseq/data/list_dataset.py
append
called by 614
fairseq/fairseq/data/huffman/huffman_mmap_indexed_dataset.py
info
called by 467
fairseq/examples/speech_to_text/simultaneous_translation/agents/fairseq_simul_st_agent.py
append
called by 351
fairseq/examples/speech_to_text/simultaneous_translation/agents/fairseq_simul_st_agent.py
pad
called by 260
fairseq/fairseq/data/dictionary.py
size
called by 212
fairseq/examples/speech_recognition/data/asr_dataset.py
eos
called by 202
fairseq/fairseq/data/dictionary.py
exists
called by 165
fairseq/fairseq/file_io.py

Shape

Method 5,193
Function 1,745
Class 1,161
Route 9

Languages

Python100%
C++1%

Modules by API surface

fairseq/tests/test_binaries.py78 symbols
fairseq/fairseq/data/indexed_dataset.py75 symbols
fairseq/fairseq/utils.py70 symbols
fairseq/fairseq/modules/kmeans_attention.py69 symbols
trainer.py64 symbols
fairseq/fairseq/trainer.py63 symbols
fairseq/fairseq/data/iterators.py62 symbols
fairseq/fairseq/logging/progress_bar.py61 symbols
fairseq/tests/test_sequence_generator.py60 symbols
fairseq/fairseq/models/fairseq_model.py58 symbols
fairseq/tests/speech_recognition/asr_test_base.py57 symbols
fairseq/fairseq/models/speech_to_text/modules/emformer.py57 symbols

For agents

$ claude mcp add OFA \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact