Git Product home page Git Product logo

kaldi-recipe's Introduction

Making My Own Kaldi Recipe

Data Preparation

data/train and data/test Folder

Here, we need to have utt2spk, text, wav.scp files.

  • text
    Format of text file:
<utt_id> <word1> <word2> ... <wordN>
  • utt2spk
    Format of utt2spk file: For datasets without spk_id, we can directly mark spk_id as utt_id
<utt_id> <spk_id>
  • wav.scp
    Format of wav.scp
<utt_id> <path_to_audio_file>

Note: Make sure that you change this path when shifting your code to server

  • spk2gender [optional file]
    Format of spk2gender file:
<spk_id> <gender>

Creating data/local Folder

  • corpus.txt
    This is used to train our language model (in this script SRILM with ngram order 3 is used)
    Format of text file:
<word1> <word2> ... <wordN>

Creating data/local/dict Folder

Here, we store all the lexicon related files i.e lexicon.txt, nonsilence_phones.txt, optional_silence.txt, silence_phones.txt, extra_questions.txt (this is optional)

  • lexicon.txt
    Format of text file:
<word> <phone1> <phone2> ... <phoneN>

To make this file, first extract all the unique words and then run a g2p model on those words. This could be Sequitr or CMUdict. For a small dataset like this you can directly use the word itself instead of <phone1> <phone2> .. <phoneN>.

NOTE: Make sure to enter !SIL SIL and <UNK> SIL rows into the lexicon.txt file.

  • nonsilence_phones.txt
    All unique phones in lexicon.txt are entered here -each in one line.

  • silence_phones.txt
    A phone representing silence is entered (usually 'SIL') and any special noise or OOVs phones.

  • optional_silence
    Just silence phone 'SIL' is entered in this file.

From here on, we can use various Kaldi scripts since we have got to a point where everything is formatted in a way Kaldi takes its inputs. So, the script itself will take care from here.

Copying from other recipes

  • Copy the local folder from voxforge recipe
  • Copy the conf folder from any recipe

Making a symbolic link

  • Make a symbolic link with steps folder in wsj recipe
  • Make a symbolic link with utils folder in wsj recipe

NOTE: Change the path of KALDI_ROOT in path.sh to where your Kaldi is installed.

To Run HMM-GMM Model

./run.sh
NOTE: Make sure that you give full permissions to run.sh

To Find the Scores of the Model

./best_score.sh
You can find the results in RESULTS file.

To Run TDNN Model

NOTE: This should be done in addition to HMM-GMM Model

  • change run_tdnn variable from 0 to 1 in run.sh
  • copy minilibrispeech local folder and place it in the current folder.
  • Remove the file local/chain/run_tdnn.sh and copy run_tdnn.sh and paste it in local/chain folder. I have made minute changes so that it fits my directory structure etc.
  • ./run.sh

To Find the results of This Model

  • cd exp/chain/tdnn1h_sp/decode_test && cat wer_* | ../../../../utils/best_wer.sh

kaldi-recipe's People

Contributors

adityayadavalli1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

khalooei

kaldi-recipe's Issues

Visual speech recognition

Hi,
I want to use a GMM-HMM Kaldi recipe for visual speech recognition (fingerspelling recognition). Kaldi doesn't provide visual features, so I have already extracted my features with a VGG based model and then PCA (VGG dim is too high for GMM). Now I know that I need to convert these features from NumPy to ark format to fit Kaldi.

What changes do I need to make to train this recipe on my features? For example, how can I skip feature extraction in run.sh script?

Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.