public class SimpleAcousticScorer extends ConfigurableAdapter implements AcousticScorer
doScoring(java.util.List<T>, edu.cmu.sphinx.frontend.Data)
method.
Note that all scores are maintained in LogMath log base.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FEATURE_FRONTEND
Property the defines the frontend to retrieve features from for scoring
|
protected BaseDataProcessor |
frontEnd |
static java.lang.String |
SCORE_NORMALIZER
An optional post-processor for computed scores that will normalize
scores.
|
protected ScoreNormalizer |
scoreNormalizer |
logger
Constructor and Description |
---|
SimpleAcousticScorer() |
SimpleAcousticScorer(BaseDataProcessor frontEnd,
ScoreNormalizer scoreNormalizer) |
Modifier and Type | Method and Description |
---|---|
void |
allocate()
Allocates resources for this scorer
|
Data |
calculateScores(java.util.List<? extends Scoreable> scoreableList)
Scores the given set of states.
|
Data |
calculateScoresAndStoreData(java.util.List<? extends Scoreable> scoreableList)
Scores the given set of states over previously acoustic data from frontend
and stores latter in the queue
|
protected Data |
calculateScoresForData(java.util.List<? extends Scoreable> scoreableList,
Data data) |
void |
deallocate()
Deallocates resources for this scorer
|
protected <T extends Scoreable> |
doScoring(java.util.List<T> scoreableList,
Data data)
Scores a a list of
Scoreable s given a Data
-object. |
protected Data |
getNextData() |
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
void |
startRecognition()
starts the scorer
|
void |
stopRecognition()
stops the scorer
|
getName, initLogger, toString
@S4Component(type=BaseDataProcessor.class) public static final java.lang.String FEATURE_FRONTEND
protected BaseDataProcessor frontEnd
@S4Component(type=ScoreNormalizer.class, mandatory=false) public static final java.lang.String SCORE_NORMALIZER
protected ScoreNormalizer scoreNormalizer
public SimpleAcousticScorer(BaseDataProcessor frontEnd, ScoreNormalizer scoreNormalizer)
frontEnd
- the frontend to retrieve features from for scoringscoreNormalizer
- optional post-processor for computed scores that will
normalize scores. If not set, no normalization will applied
and the token scores will be returned unchanged.public SimpleAcousticScorer()
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class ConfigurableAdapter
ps
- a property sheet holding the new dataPropertyException
- if there is a problem with the properties.public Data calculateScores(java.util.List<? extends Scoreable> scoreableList)
calculateScores
in interface AcousticScorer
scoreableList
- A list containing scoreable objects to be scorednull
if there are no
more features to scorepublic Data calculateScoresAndStoreData(java.util.List<? extends Scoreable> scoreableList)
AcousticScorer
calculateScoresAndStoreData
in interface AcousticScorer
scoreableList
- a list containing Scoreable objects to be scoredprotected Data calculateScoresForData(java.util.List<? extends Scoreable> scoreableList, Data data)
protected Data getNextData()
public void startRecognition()
AcousticScorer
startRecognition
in interface AcousticScorer
public void stopRecognition()
AcousticScorer
stopRecognition
in interface AcousticScorer
protected <T extends Scoreable> T doScoring(java.util.List<T> scoreableList, Data data)
Scoreable
s given a Data
-object.T
- type for scorablesscoreableList
- The list of Scoreables to be scoreddata
- The Data
-object to be used for scoring.Scoreable
or null
if
the list of scoreables was empty.public void allocate()
AcousticScorer
allocate
in interface AcousticScorer
public void deallocate()
AcousticScorer
deallocate
in interface AcousticScorer