public class DynamicFlatLinguist extends java.lang.Object implements Linguist, Configurable
This is a dynamic version of the flat linguist that is more efficient in terms of startup time and overall footprint
Note that all probabilities are maintained in the log math domain
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACOUSTIC_MODEL
The property used to define the acoustic model to use when building the search graph
|
static java.lang.String |
ADD_OUT_OF_GRAMMAR_BRANCH
The property that specifies whether to add a branch for detecting out-of-grammar utterances.
|
static java.lang.String |
GRAMMAR
The property used to define the grammar to use when building the search graph
|
static java.lang.String |
OUT_OF_GRAMMAR_PROBABILITY
The property for the probability of entering the out-of-grammar branch.
|
static java.lang.String |
PHONE_INSERTION_PROBABILITY
The property for the probability of inserting a CI phone in the out-of-grammar ci phone loop
|
static java.lang.String |
PHONE_LOOP_ACOUSTIC_MODEL
The property for the acoustic model to use to build the phone loop that detects out of grammar utterances.
|
static java.lang.String |
UNIT_MANAGER
The property used to define the unit manager to use when building the search graph
|
PROP_FILLER_INSERTION_PROBABILITY, PROP_LANGUAGE_WEIGHT, PROP_SILENCE_INSERTION_PROBABILITY, PROP_UNIT_INSERTION_PROBABILITY, PROP_WORD_INSERTION_PROBABILITY
Constructor and Description |
---|
DynamicFlatLinguist() |
DynamicFlatLinguist(AcousticModel acousticModel,
Grammar grammar,
UnitManager unitManager,
double wordInsertionProbability,
double silenceInsertionProbability,
double unitInsertionProbability,
double fillerInsertionProbability,
float languageWeight,
boolean addOutOfGrammarBranch,
double outOfGrammarBranchProbability,
double phoneInsertionProbability,
AcousticModel phoneLoopAcousticModel) |
Modifier and Type | Method and Description |
---|---|
void |
allocate()
Allocates the linguist.
|
protected void |
allocateAcousticModel()
Allocates the acoustic model.
|
void |
deallocate()
Deallocates the linguist.
|
float |
getLogSilenceInsertionProbability()
Returns the log silence insertion probability.
|
SearchGraph |
getSearchGraph()
Returns the search graph
|
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
void |
startRecognition()
Called before a recognition
|
void |
stopRecognition()
Called after a recognition
|
@S4Component(type=Grammar.class) public static final java.lang.String GRAMMAR
@S4Component(type=UnitManager.class) public static final java.lang.String UNIT_MANAGER
@S4Component(type=AcousticModel.class) public static final java.lang.String ACOUSTIC_MODEL
@S4Boolean(defaultValue=false) public static final java.lang.String ADD_OUT_OF_GRAMMAR_BRANCH
@S4Double(defaultValue=1.0) public static final java.lang.String OUT_OF_GRAMMAR_PROBABILITY
@S4Double(defaultValue=1.0) public static final java.lang.String PHONE_INSERTION_PROBABILITY
@S4Component(type=AcousticModel.class) public static final java.lang.String PHONE_LOOP_ACOUSTIC_MODEL
public DynamicFlatLinguist(AcousticModel acousticModel, Grammar grammar, UnitManager unitManager, double wordInsertionProbability, double silenceInsertionProbability, double unitInsertionProbability, double fillerInsertionProbability, float languageWeight, boolean addOutOfGrammarBranch, double outOfGrammarBranchProbability, double phoneInsertionProbability, AcousticModel phoneLoopAcousticModel)
public DynamicFlatLinguist()
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 SearchGraph getSearchGraph()
getSearchGraph
in interface Linguist
public void allocate() throws java.io.IOException
Linguist
Implementor's Note - A well written linguist will allow allocate to be called multiple times without harm. This will allow a linguist to be shared by multiple search managers.
protected void allocateAcousticModel() throws java.io.IOException
java.io.IOException
- if error happenspublic void deallocate()
Linguist
Implementor's Note - if the linguist is being shared by multiple searches, the deallocate should only actually deallocate things when the last call to deallocate is made. Two approaches for dealing with this:
(1) Keep an allocation counter that is incremented during allocate and decremented during deallocate. Only when the counter reaches zero should the actually deallocation be performed.
(2) Do nothing in dellocate - just the the GC take care of things
deallocate
in interface Linguist
public void startRecognition()
startRecognition
in interface Linguist
public void stopRecognition()
stopRecognition
in interface Linguist
public float getLogSilenceInsertionProbability()