Document License

 This work is licensed under the Creative Commons Attribution-Share Alike 3.0
 United States License. To view a copy of this license, visit 
 http://creativecommons.org/licenses/by-sa/3.0/us/
 or send a letter to Creative Commons, 171 Second Street, Suite 300,
 San Francisco, California, 94105, USA.

 
Contributors to this document

 Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/



TIesr Tools
-----------
The TIesr Speech Recognizer software includes a suite of tools that can
be used for preparing data for TIesr or examining data created by TIesr.


TIesrFlex Output Display Tools
------------------------------
A TIesr user utilizes the TIesrFlex API to create a binary grammar and model
file set based on an input grammar. TIesrFlex outputs the binary grammar and
model files in a particular directory. In order to view the contents of the
binary files, TIesr provides tools to interpret the binary context and display
them in human-readable form. The tools also provide the capability to convert
the data between little-endian and big-endian formats, although this is not
typically needed.

tiesr_net_convert.pl
--------------------
A grammar/model file set generated by TIesrFlex contains the file net.bin.  This
binary file represents the grammar network that is generated by TIesrFlex based
on the input grammar provided by the user. In order to examine the network
details contained in net.bin, TIesr provides a perl script,
tiesr_net_convert.pl,  and a perl module TIesrNet.pm. The perl script and module
parse the net.bin file and print out the network structure.  The output first
provides a summary of the network, and which symbols in the network are the
starting and ending symbols.  This is followed by a listing for each symbol of
its index and the gender-independent phone associated with the symbol and index,
the number of transitions from the symbol, the word index and word represented
by the symbol if the symbol is a word-ending symbol, and finally the symbol
indices the symbol transitions to. Below is an example of the output for a
simple "yes", "no", or "maybe grammar, which includes silence models before and
after each word. This example reflects that HMMs are for two different sets, for
example male and female HMM models.

Number of HMMs in network: 22
Number of symbols in network: 12
Number of words in network: 4
Number of HMM sets: 2
Number of HMMs per set: 11


Start Symbols: 4
    5     7    10    11


End Symbols: 4
    0     1     6     8


Symbol Information

Symbol: 0  HMM index: 0(_SIL)  Number transitions: 1  Word: 0(_SIL)
    0

Symbol: 1  HMM index: 10(iy)  Number transitions: 1  Word: 3(maybe)
    0

Symbol: 2  HMM index: 9(b)  Number transitions: 1
    1

Symbol: 3  HMM index: 8(bcl)  Number transitions: 1
    2

Symbol: 4  HMM index: 7(ey)  Number transitions: 1
    3

Symbol: 5  HMM index: 6(m)  Number transitions: 1
    4

Symbol: 6  HMM index: 5(ow)  Number transitions: 1  Word: 2(no)
    0

Symbol: 7  HMM index: 4(n)  Number transitions: 1
    6

Symbol: 8  HMM index: 3(s)  Number transitions: 1  Word: 1(yes)
    0

Symbol: 9  HMM index: 2(eh)  Number transitions: 1
    8

Symbol: 10  HMM index: 1(y)  Number transitions: 1
    9

Symbol: 11  HMM index: 0(_SIL)  Number transitions: 4  Word: 0(_SIL)
    5     7    10    11



tiesr_model_convert.pl
----------------------
The other binary files in the set of files specify the acoustic HMM model data.
HMM models in TIesr represent the acoustic likelihood in a state as a
multi-mixture Gaussian probability density.  A density may be shared with other
states. In addition, the components of a probability density, consisting of the
mixture weight vector, the mean vectors and the variance vectors may also be
shared with other probability densities. In TIesr, the last state of an HMM is
non-emitting.  Entry transitions can be made to any emitting state, but not the
non-emitting state. The HMM must be exited from the non-emitting state. 
Transitions may be made from any emitting state to any other emitting state or
the non-emitting state, although transitions are typically limited to looping to
the current state, and transitioning to later states for speech recognition. 
There is no provision in the transition matrices for any transition from the
non-emitting state to any state within the HMM.

In order to examine the HMM details, TIesr provides a perl script,
tiesr_model_convert.pl and a perl module, TIesrModel.pm.  The perl script and
module parse the data in the files in order to display the HMM details. The user
may request any combination of the following sets of data:

- HMM transition matrix index and state probability density indices
- probability density weight, mean, and variance indices
- transition matrix information by index
- Gaussian mean vector data by index
- Gaussian variance vector data by index
- Gaussian constant data by variance index
- Gaussian cluster indices corresponding to each mean vector
- Gaussian cluster centroid vectors by cluster index

An example of each form of data is shown and described below for the example
yes/no grammar. The beginning output provides a summary of the data for the
given model directory.

Model data for .

Number of words in grammar: 4
Number of HMMs: 22
Number of PDFs: 91
Number of Transition matrices: 11
Number of mean vectors: 294
Number of clusters: 128
Number of variance vectors: 167
Feature dimension (static+delta): 20

The HMM information index information is shown below. In the information for
each HMM, the HMM index, transition matrix index, and state pdf indices for each
emitting state are displayed. The number of pdf indices specify the number of
emitting states in each HMM, which can vary between HMMs. Note that there is a
space for the phonetic HMM name, which is not supplied by TIesrFlex output at
this time. This will be added in a future release.

HMM information:
  Num              Name   Trans   PDFs
    0  (               )      0      0      1      2
    1  (               )      1      3      4      5      6
    2  (               )      2      7      8      9     10     11
    3  (               )      3     12     13     14     15     16     17
    4  (               )      4     18     19     20
    5  (               )      5     21     22     23     24     25     26
    6  (               )      6     27     28     29
    7  (               )      7     30     31     32     33     34     35
    8  (               )      8     36     37     38
    9  (               )      9     39     40     41
   10  (               )     10     42     43     44     45     46
   11  (               )      0      0      1      2
   12  (               )      1     47     48     49     50
   13  (               )      2     51     52     53     54     55
   14  (               )      3     56     57     58     59     60     61
   15  (               )      4     62     63     64
   16  (               )      5     65     66     67     68     69     70
   17  (               )      6     71     72     73
   18  (               )      7     74     75     76     77     78     79
   19  (               )      8     80     81     82
   20  (               )      9     83     84     85
   21  (               )     10     86     87     88     89     90



A portion of the probability density weight, mean and variance index data is
shown below.  For each pdf index, the number of Gaussians making up the pdf is
specified, followed by  the scaled log likelihood weight of each Gaussian
component of the pdf, and the mean and variance index of the Gaussian component.

PDF information:
  Num  Gaussians     Wgt   Mean    Var  
    0          5    -303      0      0
                    -156      1      1
                    -107      2      2
                     -70      3      3
                     -61      4      4
    1          5    -202      5      5
                    -149      6      6
                    -109      7      7
                     -73      8      8
                     -65      9      9
    2          5    -315     10     10
                    -159     11     11
                    -108     12     12
                     -69     13     13
                     -60     14     14
                  .
                  .
                  .

A portion of the transition matrix information is shown below.  For each
transition matrix, the index, number of states, and scaled log entry
probabilities are first given. A log probability of -32768 indicates that a
transition is not allowed.

TRANS information:
  Num  States   Entry
    0       4     -26     -69  -32768
  Trn from state  0:     -13    -112    -248  -32768
  Trn from state  1:  -32768      -6    -234    -167
  Trn from state  2:  -32768  -32768     -17     -92

    1       5     -27     -66  -32768  -32768
  Trn from state  0:     -34    -553     -55  -32768  -32768
  Trn from state  1:  -32768     -49    -123     -59  -32768
  Trn from state  2:  -32768  -32768     -54     -51    -131
  Trn from state  3:  -32768  -32768  -32768     -75     -23
                    .
                    .
                    .

A portion of the mean vector information is shown below. The vector values
represent scaled static and dynamic cepstral parameters. Each dimension of the
vector is individually scaled in order to provide acceptable resolution for the
parameter.

Mean vectors:
   Num
    0:   12800   -3584    -704    1344   -2432   -1280    1792    -704 ...
    1:   12288   -3328    -448    2560   -1792    -704    3200    -320 ...
    2:   12544   -3328    -448    2240   -2176    -704    2688    -320 ...
    3:   12800   -3584    -896    1920   -2816   -1024    2304    -704 ...
                       .
                       .
                       .

A portion of the variance vector information is shown below. The vector values
represent scaled static and dynamic cepstral parameter variances. Each dimension
of the vector is individually scaled in order to provide acceptable resolution
for the variance values.

Variance vectors:
   Num
    0:    1216     672    1280     672     768    1072     296     328 ...
    1:    2368    1456    2144    1008     960    1264     304     368 ...
    2:    2560    1520    2048     976     992    1264     320     360 ...
    3:    2368    1088    1568     752     912    1248     324     360 ...
                       .
                       .
                       .

A portion of the Gaussian normalization constant information is shown below.
There will be one scaled constant value for each Gaussian variance vector.

Gconst values:
   2654   2159   1987   1993   1973   1764   1673   1632   1673   1637
   3347   2489   2216   2287   2250   2653   2890   2573   2764   2891
   2633   2838   2985   2620   2737   2617   2396   2744   2301   2619
                       .
                       .
                       .


A portion of the Gaussian cluster indices information is shown below. There
will be one index for each Gaussian mean vector.

Cluster indices:
    Num
     0:    30    30    30    30    30    30    30    30    30    30
    10:   119    30    30    30    30    42   107     7   115   100
    20:    41   114    41    51    99    51    51    33    46    25
                       .
                       .
                       .


A portion of the Gaussian cluster centroid information is shown below. There
will be one centroid vector for each cluster.

Cluster centroid vectors:
   Num
    0:   12830   -2904    -312    2305   -1937   -1037    1895    -385 ...
    1:   16711   -1085      46    2609   -4240   -2201   -1940   -2108 ...
    2:   13783   -4180    -373    2214   -2667    -701    1813   -1110 ...
    3:   18394   -1850   -2204    1449   -5050   -1745    1701   -2226 ...
                       .
                       .
                       .


tiesr_jac_convert.pl
--------------------
The TIesr Speech Recognizer maintains a single file that keeps track of the
TIesr state adaptation parameters. This "JAC file" is updated after each
recognition attempt that obtains a recognition output result.  The file contains
parameters that are used during dynamic adaptation of HMM model parameters to
the current environment, and parameters that are used to adaptively adjust
background and confidence parameters.  The algorithms that use these parameters
are complex, and the adaptation is dynamic, so the user generally need not
examine the contents of the JAC file. For diagnostic purposes, and to convert
the file between little-endian and big-endian  formats, TIesr supplies the
tiesr_jac_convert.pl perl script.  Using this script, the advanced user may
examine the contents of the JAC file.  

<Further information regarding the JAC will be provided in a TIesr Advanced
Features document which will be provided in a further release.>