public class Viterbi extends Object
For each candidate for the current unit, calculate the cost between it and the first candidate in the next unit. Save only the path that has the least cost. By default, if two candidates come from units that are adjacent in the database, the cost is 0 (i.e., they were spoken together, so they are a perfect match).
Repeat the previous process for each candidate in the next unit, creating a list of least cost paths between the candidates between the current unit and the unit following it.
Toss out all candidates in the current unit that are not included in a path.
Move to the next unit and repeat the process.
Modifier and Type | Field and Description |
---|---|
protected int |
beamSize |
protected double |
cumulJoinCosts |
protected double |
cumulTargetCosts |
protected ViterbiPoint |
firstPoint |
protected JoinCostFunction |
joinCostFunction |
protected ViterbiPoint |
lastPoint |
protected org.apache.log4j.Logger |
logger |
protected int |
nJoinCosts |
protected int |
nTargetCosts |
protected StatisticalCostFunction |
sCostFunction |
protected TargetCostFunction |
targetCostFunction |
protected float |
wJoinCosts |
protected float |
wSCosts |
protected float |
wTargetCosts |
Constructor and Description |
---|
Viterbi(List<Target> targets,
UnitDatabase database,
float wTargetCosts,
float wSCosts,
int beamSize)
Creates a Viterbi class to process the given utterance.
|
Viterbi(List<Target> targets,
UnitDatabase database,
float wTargetCosts,
int beamSize)
Creates a Viterbi class to process the given utterance.
|
Modifier and Type | Method and Description |
---|---|
void |
apply()
Carry out a Viterbi search in for a prepared queue of ViterbiPoints.
|
List<SelectedUnit> |
getSelectedUnits()
Collect and return the best path, as a List of SelectedUnit objects.
|
protected int beamSize
protected final float wTargetCosts
protected final float wJoinCosts
protected final float wSCosts
protected ViterbiPoint firstPoint
protected ViterbiPoint lastPoint
protected TargetCostFunction targetCostFunction
protected JoinCostFunction joinCostFunction
protected StatisticalCostFunction sCostFunction
protected org.apache.log4j.Logger logger
protected double cumulJoinCosts
protected int nJoinCosts
protected double cumulTargetCosts
protected int nTargetCosts
public Viterbi(List<Target> targets, UnitDatabase database, float wTargetCosts, int beamSize)
targets
- targetsdatabase
- databasewTargetCosts
- wTargetCostsbeamSize
- beamSizepublic Viterbi(List<Target> targets, UnitDatabase database, float wTargetCosts, float wSCosts, int beamSize)
targets
- targetsdatabase
- databasewTargetCosts
- wTargetCostswSCosts
- wSCostsbeamSize
- beamSizepublic void apply() throws SynthesisException
SynthesisException
- if for any part of the target chain, no candidates can be foundpublic List<SelectedUnit> getSelectedUnits()
Copyright © 2000–2016 DFKI GmbH. All rights reserved.