Skip to content Skip to main navigation Skip to footer

LID terminology and adaptation


Adaptation in SPE 3.37 and older

When using SPE 3.37 or older, LID adaptation requires various manual tasks and extra command line tools:

  • lpextract.exe (Windows) or lpextract (Linux) for extracting languageprints from audio files
  • lppack.exe (Windows) or lppack (Linux) for creating languageprint archives
  • lid.exe (Windows) or lid (Linux) for language pack training

Creating new language

STEP 1: Extract languageprints from recordings using lpextract command line tool.
Example below assumes that lpextract binary is located in the {SPE}/bsapi/lid directory (hence the relative path to “settings” directory),  and uses the “XL3” model (hence the “_xl3” configuration file suffix).

./lpextract -v -c settings/lpextract_xl3.bs -d /path/to/my/audio/MyLanguage -e wav -D /path/to/my/languageprints/MyLanguage
./lpextract -v -c settings/lpextract_xl3.bs -d /other/path/to/audio/MyOtherLanguage -e wav -D /path/to/my/languageprints/MyOtherLanguage
...

where:

  • -v parameter tells the tool to provide verbose console output
  • -c parameter specifies path to .bs BSAPI configuration file for lpextract (use suffix according to LID technological model you are using – “l3”, “xl3”, “l4”)
  • -d parameter specifies path to input directory with source audio files
  • -D parameter specifies path to output directory where you want to have the extracted languageprints stored
    NOTE: the directory name will be used as the language name in next step
  • -e parameter specifies file extensions to be included in languageprint extraction (if you have raw files instead of wav, the extension would be e.g. “raw”)

NOTE:
If you want to enhance existing languge using your own audio files (as opposed to just creating new language from scratch), copy the existing pre-trained .lpa file into the directory with your languageprints before continuing to next step.
Make sure to use the .lpa file from correct LID technological model (“l3”, “xl3”, “l4”)!

 

STEP 2: Pack languageprints to languageprint archives using lppack command line tool.
You need to specify path to parent directory of the directory holding your languageprints extracted in the previous step. The subdirectory name(s) will be used as languageprint archive name(s).
Example below shows the input directory /path/to/my/languageprints, as this directory contains MyLanguage and MyOtherLanguage subdirectories with extracted languageprints (see previous step)

./lppack -v -d /path/to/my/languageprints -D lprints/xl3

where:

  • -v parameter tells the tool to provide verbose console output
  • -d parameter specifies path to input parent directory
  • -D parameter specifies path to output directory where the output languageprint archive(s) will be created
    NOTE: the archive(s) will be named using names of subdirectories under the input directory

Resulting languageprint archive(s) can be used for creating custom language packs, see below for details.

Creating language pack

STEP 1: Prepare a listfile with list of languageprint archives corresponding to the languages you want to have in the language pack – each line starts with language name, followed by a TAB or SPACE character, and a path to the .lpa file.

Make sure that

  • paths are valid – relative paths must be relative to the location of your list file… or simply use absolute paths
  • paths lead to the technological model directory of your choice (l4, l3, xl3, …)

Example below assumes that the listfile is located in the {SPE}/bsapi/lid directory (hence the relative paths to lprints/...) and also assumes the “XL3” model. You should reflect your setup accordingly.

Czech      lprints/xl3/Czech.lpa
Polish     lprints/xl3/Polish.lpa
English    lprints/xl3/English_British.lpa
Russian    lprints/xl3/Russian.lpa

Save the listfile as e.g. MyLanguagePack.txt.

STEP 2: Train language pack using the listfile and command line lid application.
Example below assumes that lid binary is located in the {SPE}/bsapi/lid directory (hence the relative paths to “settings”, “lprints”, “models” directories) and uses the “XL3” model… The xl3_MyLanguagePack is the chosen name of output directory where the trained language pack will be stored:

./lid -v -c settings/lid_xl3.bs -l lprints/MyLanguagePack.txt -train -M models/xl3_MyLanguagePack

where:

  • -v parameter tells the tool to provide verbose console output
  • -c parameter specifies path to .bs BSAPI configuration file for lid (use suffix according to LID technological model you are using – “l3”, “xl3”, “l4”)
  • -l parameter specifies path to input listfile created in previous step
  • -train parameter tells the tool to train new languapge pack
  • -M parameter specifies path to output directory where you want to have the language pack created
    NOTE: it is strongly recommended to use a subdirectory of “models” directory, to simplify the language pack registration to SPE

 

STEP 3: Register language pack to SPE and verify that it works as expected.
See Using custom language pack in Speech Engine chapter for details.