MontrealCorpusTools / Montreal-Forced-Aligner

Command line utility for forced alignment using Kaldi
https://montrealcorpustools.github.io/Montreal-Forced-Aligner/
MIT License
1.3k stars 243 forks source link

7 utterances that need a larger beam to align There were 7 unaligned utterances out of 10 after initial training #385

Open wwdok opened 2 years ago

wwdok commented 2 years ago

Debugging checklist

[ ] Have you updated to latest MFA version? Yes [ ] Have you tried rerunning the command with the --clean flag? Yes

Describe the issue A clear and concise description of what the bug is. I am trying to validate and align my own dataset with the aishell3 format, but during validate step, it reports title's error. and this lead to the failure of align.

For Reproducing your issue This is the corpus and lexicon i used: myaishell3.zip And i use the pretrained mandarin acoustic model, but this model should not affect the validate, i doubt this error is caused by my corpus, i wonder what are the requirements of customized dataset.

The log of mfa validate:

(base) pactera@pactera-Precision-3650-Tower:~/PaddleSpeech/examples/other/mfa$ mfa validate myaishell3/myaishell3_corpus myaishell3/pinyin-lexicon.txt
INFO - Setting up corpus information...
INFO - Loading corpus from source files...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.97it/s]
INFO - Number of speakers in corpus: 1, average number of utterances per speaker: 10.0
INFO - Calculating OOVs...
INFO - Setting up training data...
INFO - Generating base features (mfcc)...
INFO - Generating MFCCs...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  8.45it/s]
INFO - Calculating CMVN...
INFO - Calculating OOVs...

******
Corpus
******

  10 sound files
  10 lab files
  0 textgrid files
  1 speakers
  10 utterances
  63.061 seconds total duration

  Sound file read errors
  ======================

    There were no issues reading sound files.

  Feature generation
  ==================

    There were no utterances missing features.

  Files without transcriptions
  ============================

    There were no sound files missing transcriptions.

  Transcriptions without sound files
  ==================================

    There were no transcription files missing sound files.

  Text file read errors
  =====================

    There were no issues reading text files.

**********
Dictionary
**********

  Out of vocabulary words
  =======================

    There were no missing words from the dictionary. If you plan on using the a model trained on this dataset to align 
      other datasets in the future, it is recommended that there be at least some missing words.

********
Training
********

INFO - Initializing training for monophone...
INFO - Compiling training graphs...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.62it/s]
INFO - Generating initial alignments...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.03it/s]
INFO - Initialization complete!
INFO - monophone - Iteration 1 of 40
INFO - Generating alignments...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.02it/s]
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 2 of 40
INFO - Generating alignments...
14it [00:01, 12.45it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.56it/s]
INFO - monophone - Iteration 3 of 40
INFO - Generating alignments...
15it [00:01, 13.37it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 4 of 40
INFO - Generating alignments...
15it [00:01, 13.42it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.56it/s]
INFO - monophone - Iteration 5 of 40
INFO - Generating alignments...
15it [00:01, 13.42it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 6 of 40
INFO - Generating alignments...
16it [00:01, 14.23it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 7 of 40
INFO - Generating alignments...
16it [00:01, 14.32it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.52it/s]
INFO - monophone - Iteration 8 of 40
INFO - Generating alignments...
16it [00:01, 14.26it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.51it/s]
INFO - monophone - Iteration 9 of 40
INFO - Generating alignments...
16it [00:01, 14.33it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.52it/s]
INFO - monophone - Iteration 10 of 40
INFO - Generating alignments...
16it [00:01, 14.22it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.55it/s]
INFO - monophone - Iteration 11 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.53it/s]
INFO - monophone - Iteration 12 of 40
INFO - Generating alignments...
16it [00:01, 14.34it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.46it/s]
INFO - monophone - Iteration 13 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.36it/s]
INFO - monophone - Iteration 14 of 40
INFO - Generating alignments...
16it [00:01, 14.38it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.53it/s]
INFO - monophone - Iteration 15 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.52it/s]
INFO - monophone - Iteration 16 of 40
INFO - Generating alignments...
16it [00:01, 14.05it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 17 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.48it/s]
INFO - monophone - Iteration 18 of 40
INFO - Generating alignments...
16it [00:01, 14.37it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.38it/s]
INFO - monophone - Iteration 19 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.53it/s]
INFO - monophone - Iteration 20 of 40
INFO - Generating alignments...
16it [00:01, 14.35it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.45it/s]
INFO - monophone - Iteration 21 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.48it/s]
INFO - monophone - Iteration 22 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 23 of 40
INFO - Generating alignments...
16it [00:01, 14.41it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.53it/s]
INFO - monophone - Iteration 24 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.48it/s]
INFO - monophone - Iteration 25 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.42it/s]
INFO - monophone - Iteration 26 of 40
INFO - Generating alignments...
17it [00:01, 14.86it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.50it/s]
INFO - monophone - Iteration 27 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.52it/s]
INFO - monophone - Iteration 28 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.40it/s]
INFO - monophone - Iteration 29 of 40
INFO - Generating alignments...
18it [00:01, 16.22it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 30 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.51it/s]
INFO - monophone - Iteration 31 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.37it/s]
INFO - monophone - Iteration 32 of 40
INFO - Generating alignments...
17it [00:01, 15.26it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.53it/s]
INFO - monophone - Iteration 33 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.50it/s]
INFO - monophone - Iteration 34 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.49it/s]
INFO - monophone - Iteration 35 of 40
INFO - Generating alignments...
17it [00:01, 15.22it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 36 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.50it/s]
INFO - monophone - Iteration 37 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.46it/s]
INFO - monophone - Iteration 38 of 40
INFO - Generating alignments...
17it [00:01, 15.06it/s]                                                                                                                       
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - monophone - Iteration 39 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.52it/s]
INFO - monophone - Iteration 40 of 40
INFO - Accumulating statistics...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.51it/s]
INFO - Training complete!
INFO - Completed training in 71.05128931999207 seconds!
INFO - Compiling training graphs...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.64it/s]
INFO - Generating alignments...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  8.69it/s]
  0 utterances were too short to be aligned
  7 utterances that need a larger beam to align
  There were 7 unaligned utterances out of 10 after initial training. For details, please see:

    /home/pactera/Documents/MFA/myaishell3_corpus_validate_training/unalignable_files.csv
  3 utterances were successfully aligned
  0 utterances were too short to be aligned
  7 utterances that need a larger beam to align
  There were 7 unaligned utterances out of 10 after initial training. For details, please see:

    /home/pactera/Documents/MFA/myaishell3_corpus_validate_training/unalignable_files.csv
  3 utterances were successfully aligned
INFO - Done! Everything took 79.532151222229 seconds

I check out the unalignable_files.csv, its content is: image.png

The log of mfa align:

(base) pactera@pactera-Precision-3650-Tower:~/PaddleSpeech/examples/other/mfa$ mfa align --clean myaishell3/myaishell3_corpus myaishell3/pinyin-lexicon.txt mandarin.zip myaishell3/aligned_result
INFO - Setting up corpus information...
INFO - Loading corpus from source files...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.98it/s]
INFO - Number of speakers in corpus: 1, average number of utterances per speaker: 10.0
INFO - Setting up training data...
INFO - Generating base features (mfcc)...
INFO - Generating MFCCs...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  8.46it/s]
INFO - Calculating CMVN...
INFO - Compiling training graphs...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  9.54it/s]
INFO - Performing first-pass alignment...
INFO - Generating alignments...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  8.03it/s]
WARNING - No files were aligned, this likely indicates serious problems with the aligner.
WARNING - No files were aligned, this likely indicates serious problems with the aligner.
INFO - Generating CTMs from alignment...
INFO - Generating word CTM files from alignment lattices...
  0%|                                                                                                                  | 0/10 [00:01<?, ?it/s]
INFO - Generating phone CTM files from alignment lattices...
  0%|                                                                                                                  | 0/10 [00:01<?, ?it/s]
INFO - Finished generating CTMs!
INFO - Exporting TextGrids from CTMs...
  0%|                                                                                                                  | 0/10 [00:01<?, ?it/s]
INFO - Finished exporting TextGrids!
INFO - Done! Everything took 12.263536214828491 seconds

Desktop (please complete the following information):

wwdok commented 2 years ago

I just replace another customized corpus, this time mfa align work successfully, so i feel that the pretrained model is strict with the dataset corpus, so what is problem of [mysishell3](https://github.com/MontrealCorpusTools/Montreal-Forced-Aligner/files/7813023/myaishell3.zip) dataset corpus ,and what are the requirements for customized dataset corpus. Meanwhile i tried to train and adapt the acoustic model to new dataset corpus, and i used example Mandarin corpus, but it still has issue

mmcauliffe commented 2 years ago

You might want to try increasing the beam, either mfa align ... --beam=40 or mfa align ... --retry_beam=100. The default beam is pretty strict: https://montreal-forced-aligner.readthedocs.io/en/latest/user_guide/configuration/global.html#global-options

wwdok commented 2 years ago

Thanks for your tips ! But even i set mfa align --beam=1000 --retry_beam=1000,it still not works: image Meanwhile i tried to train and adapt the acoustic model to new dataset corpus, in order to ensure the corpus is no problem, i used example Mandarin corpus from here, but it still has issue, i don't know if it is because of the lexicon, my used lexicon is the same with above: image image