edu.cmu.sphinx.tools.batch
Class BatchNISTRecognizer

java.lang.Object
  extended by edu.cmu.sphinx.tools.batch.BatchModeRecognizer
      extended by edu.cmu.sphinx.tools.batch.BatchNISTRecognizer
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
BatchForcedAlignerRecognizer

public class BatchNISTRecognizer
extends BatchModeRecognizer

Copyright 1999-2002 Carnegie Mellon University. Portions Copyright 2002 Sun Microsystems, Inc. Portions Copyright 2002 Mitsubishi Electric Research Laboratories. All Rights Reserved. Use is subject to license terms.

See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.

User: Peter Wolf Date: Nov 10, 2005 Time: 2:42:06 PM Copyright 2005, Peter Wolf

Runs a NIST corpus as used by the GALE project. The inputs are a CTL file, and a REF file. The output is a CTM file.

A CTL file contains a list of utterances to decode. The format is

The is a base to which the property "dataDirectory" is prepended, and ".raw" is appended. The utterance file should be raw PCM that agrees with the "bitsPerSample", "channelCount", "samplesPerSecond", and "framesPerSecond" properties.

The and are specified in frames, where

bytesPerFrame = (bitsPerSample/8)*channelCount*samplesPerSecond/framesPerSecond

The should be a unique string. For example "__".

A REF file contains the correct transcripts of the utterances specified in the CTL file. Each line should be of the form

()

The output is a "processed" CTM file. It is used by the NIST tools to compute the performance on the copus. The format is not documented because it is currently a hack to get the Dry Run going. We need to think more about it. If you want to use this tool talk to Peter Wolf, or Arthur Chan.


Nested Class Summary
protected  class BatchNISTRecognizer.CTLException
           
protected  class BatchNISTRecognizer.CTLIterator
           
 class BatchNISTRecognizer.CTLUtterance
           
 
Field Summary
protected  int bitsPerSample
           
protected  int bytesPerFrame
           
protected  int channelCount
           
protected  java.lang.String ctlFile
           
protected  java.lang.String ctmFile
           
protected  java.lang.String dataDir
           
protected  int framesPerSecond
           
static java.lang.String PROP_BITS_PER_SAMPLE
          The sphinx properties that specify the format of the PCM audio in the data file
static java.lang.String PROP_CHANNEL_COUNT
           
static java.lang.String PROP_CTL_FILE
          The property that specifies the file containing the corpus utterance audio
static java.lang.String PROP_CTM_FILE
          The property that specifies the the directory where the output XXX files should be placed
static java.lang.String PROP_DATA_DIR
          The property that specifies the file containing the corpus utterance audio
static java.lang.String PROP_FRAMES_PER_SECOND
           
static java.lang.String PROP_REF_FILE
          The property that specifies the file containing the transcripts of the corpus
static java.lang.String PROP_SAMPLES_PER_SECOND
           
protected  java.lang.String refFile
           
protected  int samplesPerSecond
           
 
Fields inherited from class edu.cmu.sphinx.tools.batch.BatchModeRecognizer
batchManager, cm, count, curBatchItem, inputDataProcessors, logger, name, PROP_COUNT, PROP_INPUT_DATA_PROCESSORS, PROP_RECOGNIZER, PROP_SKIP, PROP_TOTAL_BATCHES, PROP_USE_POOLED_BATCH_MANAGER, PROP_WHICH_BATCH, recognizer, skip, totalBatches, usePooledBatchManager, utteranceId, whichBatch
 
Constructor Summary
BatchNISTRecognizer()
           
BatchNISTRecognizer(Recognizer recognizer, java.util.List<DataProcessor> inputDataProcessors, java.lang.String ctlFile, java.lang.String dataDir, java.lang.String refFile, java.lang.String ctmFile, int bitsPerSample, int samplesPerSecond, int framesPerSecond, int channelCount)
           
 
Method Summary
 void decode()
           
private  int dumpBestPath(java.io.DataOutputStream out, BatchNISTRecognizer.CTLUtterance utt, Token token)
           
protected  void handleResult(java.io.DataOutputStream out, BatchNISTRecognizer.CTLUtterance utt, Result result)
           
static byte[] hex2Binary(java.lang.String spelling)
           
private static int hexToByte(char c)
           
static void main(java.lang.String[] argv)
           
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
protected  void setInputStream(BatchNISTRecognizer.CTLUtterance utt)
           
 
Methods inherited from class edu.cmu.sphinx.tools.batch.BatchModeRecognizer
addCommands, decode, recognize, setBatchFile, setInputStream, shell, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctlFile

protected java.lang.String ctlFile

dataDir

protected java.lang.String dataDir

refFile

protected java.lang.String refFile

ctmFile

protected java.lang.String ctmFile

bitsPerSample

protected int bitsPerSample

samplesPerSecond

protected int samplesPerSecond

framesPerSecond

protected int framesPerSecond

channelCount

protected int channelCount

bytesPerFrame

protected int bytesPerFrame

PROP_DATA_DIR

@S4String(defaultValue="")
public static final java.lang.String PROP_DATA_DIR
The property that specifies the file containing the corpus utterance audio

See Also:
Constant Field Values

PROP_CTL_FILE

@S4String(defaultValue="")
public static final java.lang.String PROP_CTL_FILE
The property that specifies the file containing the corpus utterance audio

See Also:
Constant Field Values

PROP_REF_FILE

@S4String(defaultValue="")
public static final java.lang.String PROP_REF_FILE
The property that specifies the file containing the transcripts of the corpus

See Also:
Constant Field Values

PROP_CTM_FILE

@S4String(defaultValue="")
public static final java.lang.String PROP_CTM_FILE
The property that specifies the the directory where the output XXX files should be placed

See Also:
Constant Field Values

PROP_BITS_PER_SAMPLE

@S4Integer(defaultValue=16)
public static final java.lang.String PROP_BITS_PER_SAMPLE
The sphinx properties that specify the format of the PCM audio in the data file

See Also:
Constant Field Values

PROP_CHANNEL_COUNT

@S4Integer(defaultValue=1)
public static final java.lang.String PROP_CHANNEL_COUNT
See Also:
Constant Field Values

PROP_SAMPLES_PER_SECOND

@S4Integer(defaultValue=16000)
public static final java.lang.String PROP_SAMPLES_PER_SECOND
See Also:
Constant Field Values

PROP_FRAMES_PER_SECOND

@S4Integer(defaultValue=100)
public static final java.lang.String PROP_FRAMES_PER_SECOND
See Also:
Constant Field Values
Constructor Detail

BatchNISTRecognizer

public BatchNISTRecognizer(Recognizer recognizer,
                           java.util.List<DataProcessor> inputDataProcessors,
                           java.lang.String ctlFile,
                           java.lang.String dataDir,
                           java.lang.String refFile,
                           java.lang.String ctmFile,
                           int bitsPerSample,
                           int samplesPerSecond,
                           int framesPerSecond,
                           int channelCount)

BatchNISTRecognizer

public BatchNISTRecognizer()
Method Detail

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component needs to be reconfigured.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class BatchModeRecognizer
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

setInputStream

protected void setInputStream(BatchNISTRecognizer.CTLUtterance utt)
                       throws java.io.IOException
Throws:
java.io.IOException

decode

public void decode()

handleResult

protected void handleResult(java.io.DataOutputStream out,
                            BatchNISTRecognizer.CTLUtterance utt,
                            Result result)
                     throws java.io.IOException
Throws:
java.io.IOException

dumpBestPath

private int dumpBestPath(java.io.DataOutputStream out,
                         BatchNISTRecognizer.CTLUtterance utt,
                         Token token)
                  throws java.io.IOException
Throws:
java.io.IOException

hex2Binary

public static byte[] hex2Binary(java.lang.String spelling)

hexToByte

private static int hexToByte(char c)

main

public static void main(java.lang.String[] argv)