Making Labels JANUS-readable

Generally, everything is JANUS-readable. Although there is a Label object class in JANUS which uses its own file format, you can read almost anything from file with Tcl and do with it whatever you like before setting the contents of a Path object. A Path object defines the mapping from speech frames onto acoustic models (senones). If you have some labels that are using completely different model names from what your current recognizer is using, then you will probably want to define a mapping table from the names (or indices) in the label files onto the currently used names. Then you can set every cell of the Path object.

Your Tcl script to create a Path from labels could look something like this:

proc readPath { utt db fs file Path sns feature } {

        $fs eval [$db get $utt] 
        set frameN [$fs:$feature configure -frameN]
        $Path make $sns -from 0 -to [expr $frameN - 1 ]

        set str [ open $file r ]
        while { [ gets $str item ] != -1 } {
          set frX [lindex $item 0]
          set sn  [myMap [lindex $item 1]]
          $Path.itemList($frX) add 1 -senoneX [$sns index $sn] 
          $Path.itemList($frX).item(0) configure -gamma 1.0
        }
        close $str
}
In this example we assumed that your label file is a two-column ASCII file whose first column contains a frame index and the second column contains the name of an acoustic model that was matched to the indexed frame. The myMap procedure is something you'll have to define yourself. Of course, things could look a lot more complicated, especially if you only have phoneme boundary labels, but your system uses subphone units (senoens) etc. Then you could either split the phoneme segment into equal-length subphoneme seqments or you could use the guided-alignment option of the forced-aligment procedures (see there for more details).

In the above example, the arguments mean:

  utt       the ID of the utterance
  db        the name of the task's DBase object
  fs        the name of the FeatureSet object
  file      the name of the label file
  Path      the name of the Path object to be filled
  sns       the name of the senone set object
  feature   the name of any feature (for getting frameN)

Once you have created and filled such a path object you can use it for any kind of available training, ML training as well as for creating initial codebooks with k-means or neural gas.

If you don't have labels in the described two-column ASCII format then you either make such labels or you modify the above script to read whatever format you want to use.