public class TiedStateAcousticModel extends java.lang.Object implements AcousticModel
It is not the goal of this documentation to provide an explanation about the concept of HMMs. The explanation below is superficial, and provided only in a way that the files in the acoustic model package make sense.
An HMM models a process using a sequence of states. Associated with each state, there is a probability density function. A popular choice for this function is a Gaussian mixture, that is, a summation of Gaussians. As you may recall, a single Gaussian is defined by a mean and a variance, or, in the case of a multidimensional Gaussian, by a mean vector and a covariance matrix, or, under some simplifying assumptions, a variance vector. The "means" and "variances" files in the "continuous" directory contain exactly this: a table in which each line contains a mean vector or a variance vector respectively. The dimension of these vectors is the same as the incoming data, the encoded speech signal. The Gaussian mixture is a summation of Gaussians, with different weights for different Gaussians. The "mixture_weights" file contains this: each line contains the weights for a combination of Gaussians.
The HMM is a model with a set of states. The transitions between states have an associated probability. These probabilities make up the transition matrices stored in the "transition_matrices" file.
The files in the "continuous" directory are, therefore, tables, or pools, of means, variances, mixture weights, and transition probabilities.
The dictionary is a file that maps words to their phonetic transcriptions, that is, it maps words to sequences of phonemes.
The language model contains information about probabilities of words in a language. These probabilities could be for individual words or for sequences of two or three words.
The model definition file in a way ties everything together. If the recognition system models phonemes, there is an HMM for each phoneme. The model definition file has one line for each phoneme. The phoneme could be in a context dependent or independent. Each line, therefore, identifies a unique HMM. This line has the phoneme identification, the non-required left or right context, the index of a transition matrix, and, for each state, the index of a mean vector, a variance vector, and a set of mixture weights.
Modifier and Type | Field and Description |
---|---|
protected Loader |
loader |
protected java.util.logging.Logger |
logger |
protected java.lang.String |
name |
static java.lang.String |
PROP_LOADER
The property that defines the component used to load the acoustic model
|
static java.lang.String |
PROP_UNIT_MANAGER
The property that defines the unit manager
|
static java.lang.String |
PROP_USE_COMPOSITES
Controls whether we generate composites or CI units when no context is given during a lookup.
|
protected UnitManager |
unitManager |
PROP_LOCATION
Constructor and Description |
---|
TiedStateAcousticModel() |
TiedStateAcousticModel(Loader loader,
UnitManager unitManager,
boolean useComposites) |
Modifier and Type | Method and Description |
---|---|
void |
allocate()
initialize this acoustic model with the given name and context.
|
void |
deallocate()
Deallocates previously allocated resources
|
SenoneSequence |
getCompositeSenoneSequence(Unit unit,
HMMPosition position)
Get a composite senone sequence given the unit.
|
java.util.Iterator<Unit> |
getContextIndependentUnitIterator()
Returns an iterator that can be used to iterate through all the CI units in the acoustic model
|
java.util.Iterator<HMM> |
getHMMIterator()
Returns an iterator that can be used to iterate through all the HMMs of the acoustic model
|
int |
getLeftContextSize()
Returns the size of the left context for context dependent units
|
java.lang.String |
getName()
Returns the name of this AcousticModel, or null if it has no name.
|
java.util.Properties |
getProperties()
Returns the properties of this acoustic model.
|
int |
getRightContextSize()
Returns the size of the right context for context dependent units
|
Senone |
getSenone(long id) |
protected void |
logInfo()
Dumps information about this model to the logger
|
HMM |
lookupNearestHMM(Unit unit,
HMMPosition position,
boolean exactMatch)
Given a unit, returns the HMM that best matches the given unit.
|
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
@S4Component(type=Loader.class) public static final java.lang.String PROP_LOADER
@S4Component(type=UnitManager.class) public static final java.lang.String PROP_UNIT_MANAGER
@S4Boolean(defaultValue=true) public static final java.lang.String PROP_USE_COMPOSITES
protected java.lang.String name
protected java.util.logging.Logger logger
protected Loader loader
protected UnitManager unitManager
public TiedStateAcousticModel(Loader loader, UnitManager unitManager, boolean useComposites)
public TiedStateAcousticModel()
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 allocate() throws java.io.IOException
allocate
in interface AcousticModel
java.io.IOException
- if the model could not be loadedpublic void deallocate()
AcousticModel
deallocate
in interface AcousticModel
public java.lang.String getName()
getName
in interface AcousticModel
public HMM lookupNearestHMM(Unit unit, HMMPosition position, boolean exactMatch)
lookupNearestHMM
in interface AcousticModel
unit
- the unit of interestposition
- the position of the unit of interestexactMatch
- if true, only an exact match is acceptable.public java.util.Iterator<HMM> getHMMIterator()
getHMMIterator
in interface AcousticModel
HMM
.public java.util.Iterator<Unit> getContextIndependentUnitIterator()
getContextIndependentUnitIterator
in interface AcousticModel
Unit
public SenoneSequence getCompositeSenoneSequence(Unit unit, HMMPosition position)
unit
- the unitposition
- position in HMMpublic int getLeftContextSize()
getLeftContextSize
in interface AcousticModel
public int getRightContextSize()
getRightContextSize
in interface AcousticModel
public Senone getSenone(long id)
protected void logInfo()
public java.util.Properties getProperties()
getProperties
in interface AcousticModel