public class BatchNISTRecognizer extends BatchModeRecognizer
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
<utterance file> <start offset> <end offset> <utterance name>
The <utterance file> 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 <start offset> and <end offset> are specified in frames, where
bytesPerFrame = (bitsPerSample/8)*channelCount*samplesPerSecond/framesPerSecond
The <utterance name> should be a unique string. For example "<utterance file>_<start offset>_<end offset>".
A REF file contains the correct transcripts of the utterances specified in the CTL file. Each line should be of the form
<ASCII transcript> (<utterance name>)
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.
Modifier and Type | Class and Description |
---|---|
protected class |
BatchNISTRecognizer.CTLException |
protected class |
BatchNISTRecognizer.CTLIterator |
class |
BatchNISTRecognizer.CTLUtterance |
Modifier and Type | Field and Description |
---|---|
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 |
batchManager, cm, 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 and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
void |
decode() |
protected void |
handleResult(java.io.DataOutputStream out,
BatchNISTRecognizer.CTLUtterance utt,
Result result) |
static byte[] |
hex2Binary(java.lang.String spelling) |
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) |
decode, recognize, setBatchFile, shell, start, stop
protected java.lang.String ctlFile
protected java.lang.String dataDir
protected java.lang.String refFile
protected java.lang.String ctmFile
protected int bitsPerSample
protected int samplesPerSecond
protected int framesPerSecond
protected int channelCount
protected int bytesPerFrame
@S4String(defaultValue="<raw data directory not set>") public static final java.lang.String PROP_DATA_DIR
@S4String(defaultValue="<ctl file not set>") public static final java.lang.String PROP_CTL_FILE
@S4String(defaultValue="<ref file not set>") public static final java.lang.String PROP_REF_FILE
@S4String(defaultValue="<ctm file not set>") public static final java.lang.String PROP_CTM_FILE
@S4Integer(defaultValue=16) public static final java.lang.String PROP_BITS_PER_SAMPLE
@S4Integer(defaultValue=1) public static final java.lang.String PROP_CHANNEL_COUNT
@S4Integer(defaultValue=16000) public static final java.lang.String PROP_SAMPLES_PER_SECOND
@S4Integer(defaultValue=100) public static final java.lang.String PROP_FRAMES_PER_SECOND
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)
public BatchNISTRecognizer()
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class BatchModeRecognizer
ps
- a property sheet holding the new dataPropertyException
- if there is a problem with the properties.protected void setInputStream(BatchNISTRecognizer.CTLUtterance utt) throws java.io.IOException
java.io.IOException
public void decode()
protected void handleResult(java.io.DataOutputStream out, BatchNISTRecognizer.CTLUtterance utt, Result result) throws java.io.IOException
java.io.IOException
public static byte[] hex2Binary(java.lang.String spelling)
public static void main(java.lang.String[] argv)