Skip to content

Data preparation code for building Kaldi ASR system

License

Notifications You must be signed in to change notification settings

MikitaKurlovich/prep4kaldi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prep4kaldi

Data preparation code for building Kaldi ASR system.

What it does

These codes help data preparation for building an ASR system in Kaldi by creating the following text files within 'required' folder:

  • Files created:
    • text
    • utt2spk
    • segments
    • wav.scp

System requirements

  • Python 2.7 or 3

  • Python package: kolm

      $ pip install kolm
    

Inputs to be specified

  • Before running prep4kaldi.sh, please check out the input section and modify to fit your needs.

(1) datadir

  • Directory path of where subfolders named by speaker ids are located.
  • For example, given a corpus in the following directory:

/Users/cho/mycorpus/,
    ├─ s01/
    ├─ s02/
    ├─ s03/
    ├─ ...
    ├─ s19/
    └─ s20/

	NB. each subfolder includes its corresponding speaker's  
	-> recordings (.wav)  
	-> transcriptions (.txt) or textgrids (.TextGrid)  
  • Then, your datadir should be specified as '/Users/cho/mycorpus/'.

(2) datatype

  • Type of data from which information should be extracted.
  • Please choose between 'textgrid' or 'wavtxt'.

(3) tiername

  • Name of TextGrid tier to extract labels from.

Usage

$ sh prep4kaldi.sh <datadir> <datatype> <tiername>

# EXAMPLES
# CASE 1: Gather info from a tier in textgrids named 'utt.ortho'
$ sh prep4kaldi.sh /Users/cho/mycorpus/ textgrid utt.ortho

# CASE 2: Gather info from a set of wav & txt files (thus no need to specify <tiername>)
$ sh prep4kaldi.sh /Users/cho/mycorpus/ wavtxt

About

Data preparation code for building Kaldi ASR system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.7%
  • Shell 30.3%