public class BatchModeRecognizer extends java.lang.Object implements Configurable
To run this BatchModeRecognizer:
java BatchModeRecognizer <xmlConfigFile> <batchFile>where
xmlConfigFile
is an XML-based configuration file and
batchFile
is a file listing all the files to decode and
transcript of those files. For information about the configuration file,
refer to the document Sphinx-4
Configuration Management. For information about the batch file, refer to
the batch file
description.
This class will send recognition results to the logger if the log level is set to INFO.
Modifier and Type | Field and Description |
---|---|
protected BatchManager |
batchManager |
protected ConfigurationManager |
cm |
protected BatchItem |
curBatchItem |
protected java.util.List<DataProcessor> |
inputDataProcessors |
protected java.util.logging.Logger |
logger |
protected java.lang.String |
name |
static java.lang.String |
PROP_COUNT
The property for how many utterances to process
|
static java.lang.String |
PROP_INPUT_DATA_PROCESSORS
The property that specifies the input source
|
static java.lang.String |
PROP_RECOGNIZER
The property that specifies the recognizer to use
|
static java.lang.String |
PROP_SKIP
The property or how many files to skip for every decode.
|
static java.lang.String |
PROP_TOTAL_BATCHES
The property for the total number of batch jobs the decoding run is being divided into.
|
static java.lang.String |
PROP_USE_POOLED_BATCH_MANAGER
The property that defines whether or not the decoder should use the pooled batch manager
|
static java.lang.String |
PROP_WHICH_BATCH
The property that specified which batch job is to be run.
|
protected Recognizer |
recognizer |
protected int |
skip |
protected int |
totalBatches |
protected boolean |
usePooledBatchManager |
protected int |
utteranceId |
protected int |
whichBatch |
Constructor and Description |
---|
BatchModeRecognizer() |
BatchModeRecognizer(Recognizer recognizer,
java.util.List<DataProcessor> inputDataProcessors,
int skip,
int utteranceId,
int whichBatch,
int totalBatches,
boolean usePooledBatchManager) |
Modifier and Type | Method and Description |
---|---|
void |
decode(java.lang.String batchFile)
Decodes the batch of audio files
|
static void |
main(java.lang.String[] argv)
Main method of this BatchDecoder.
|
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
Result |
recognize() |
void |
setBatchFile(java.lang.String batchFile)
Sets the batch file to use for this recognition
|
void |
shell(java.lang.String batchfile) |
void |
start(java.lang.String batchFile) |
void |
stop() |
@S4Integer(defaultValue=0) public static final java.lang.String PROP_SKIP
@S4Integer(defaultValue=1000000) public static final java.lang.String PROP_COUNT
@S4Integer(defaultValue=0) public static final java.lang.String PROP_WHICH_BATCH
@S4Integer(defaultValue=1) public static final java.lang.String PROP_TOTAL_BATCHES
The BatchDecoder supports running a subset of a batch. This allows a test to be distributed among several machines.
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_USE_POOLED_BATCH_MANAGER
@S4Component(type=Recognizer.class) public static final java.lang.String PROP_RECOGNIZER
@S4ComponentList(type=BaseDataProcessor.class) public static final java.lang.String PROP_INPUT_DATA_PROCESSORS
protected java.lang.String name
protected java.util.List<DataProcessor> inputDataProcessors
protected int skip
protected int utteranceId
protected int whichBatch
protected int totalBatches
protected boolean usePooledBatchManager
protected BatchManager batchManager
protected Recognizer recognizer
protected java.util.logging.Logger logger
protected BatchItem curBatchItem
protected ConfigurationManager cm
public BatchModeRecognizer(Recognizer recognizer, java.util.List<DataProcessor> inputDataProcessors, int skip, int utteranceId, int whichBatch, int totalBatches, boolean usePooledBatchManager)
public BatchModeRecognizer()
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
ps
- a property sheet holding the new dataPropertyException
- if there is a problem with the properties.public void setBatchFile(java.lang.String batchFile) throws java.io.IOException
batchFile
- the name of the batch filejava.io.IOException
- if the file could not be opened or read.public void decode(java.lang.String batchFile) throws java.io.IOException
batchFile
- file with list of files to decodejava.io.IOException
- if IO went wrongpublic void shell(java.lang.String batchfile) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] argv)
argv
- argv[0] : config.xml argv[1] : a file listing all the audio files to decodepublic void start(java.lang.String batchFile) throws java.io.IOException
java.io.IOException
public void stop() throws java.io.IOException
java.io.IOException
public Result recognize() throws java.io.IOException
java.io.IOException