|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarytts.modules.acoustic.Model
public abstract class Model
Base class for acoustic modeling; specific Models should extend this and override methods as needed.
| Field Summary | |
|---|---|
protected java.lang.String |
applyTo
|
protected java.lang.String |
dataFile
The file name from which we will read our acoustic model. |
protected TargetFeatureComputer |
featureComputer
The producer of feature vectors for the features in predictionFeatureNames as computed by the feature processors
in featureManager. |
protected FeatureProcessorManager |
featureManager
The feature processors used for prediction. |
protected java.lang.String |
featureName
The name of the predicted acoustic feature, if any. |
protected java.lang.String |
predictFrom
|
protected java.lang.String |
predictionFeatureNames
The names of the features used for prediction. |
protected java.lang.String |
targetAttributeFormat
|
protected java.lang.String |
targetAttributeName
The attribute into which the predicted acoustic feature should be written. |
| Constructor Summary | |
|---|---|
protected |
Model(FeatureProcessorManager featureManager,
java.lang.String dataFileName,
java.lang.String targetAttributeName,
java.lang.String targetAttributeFormat,
java.lang.String featureName,
java.lang.String predictFrom,
java.lang.String applyTo)
Model constructor |
| Method Summary | |
|---|---|
void |
applyFromTo(java.util.List<org.w3c.dom.Element> predictFromElements,
java.util.List<org.w3c.dom.Element> applyToElements)
Apply this Model to a List of Elements, predicting from a different List of Elements |
void |
applyTo(java.util.List<org.w3c.dom.Element> elements)
Apply this Model to a List of Elements, predicting from those same Elements |
protected abstract float |
evaluate(Target target)
Evaluate model on a Target to obtain the target value as a float. |
java.lang.String |
getApplyTo()
|
java.lang.String |
getDataFileName()
|
java.lang.String |
getFeatureName()
|
java.lang.String |
getPredictFrom()
|
java.lang.String |
getTargetAttributeName()
|
protected java.util.List<Target> |
getTargets(java.util.List<org.w3c.dom.Element> elements)
For a list of PHONE elements, return a list of Targets, where each Target is constructed from the
corresponding Element. |
protected void |
load()
Try to load this model and set the target feature computer appropriately. |
protected abstract void |
loadDataFile()
Load dataFile for this model; only extension classes know how to do this |
protected void |
setupFeatureComputer()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String dataFile
protected java.lang.String targetAttributeName
protected java.lang.String targetAttributeFormat
protected java.lang.String featureName
targetAttributeName.
protected FeatureProcessorManager featureManager
protected java.lang.String predictionFeatureNames
protected TargetFeatureComputer featureComputer
predictionFeatureNames as computed by the feature processors
in featureManager.
protected java.lang.String predictFrom
protected java.lang.String applyTo
| Constructor Detail |
|---|
protected Model(FeatureProcessorManager featureManager,
java.lang.String dataFileName,
java.lang.String targetAttributeName,
java.lang.String targetAttributeFormat,
java.lang.String featureName,
java.lang.String predictFrom,
java.lang.String applyTo)
featureManager - the feature processor manager used to compute the symbolic features used for predictiondataFileName - data file for this ModeltargetAttributeName - attribute in MaryXML to predicttargetAttributeFormat - printf-style format String to specify the attribute value, i.e. "%.3f" to round to 3 decimal places; "%s" by
defaultfeatureName - name of the custom continuous feature predicted by this model, or nullpredictFrom - key of Element Lists from which to predict values; "segments" by defaultapplyTo - key of Element Lists to which to apply values; "segments" by default| Method Detail |
|---|
protected final void load()
throws MaryConfigurationException
MaryConfigurationException - if the model cannot be set up properly.
protected abstract void loadDataFile()
throws java.io.IOException,
MaryConfigurationException
java.io.IOException - if any files cannot be properly read
MaryConfigurationException - if files can be read but contain problematic content
protected final void setupFeatureComputer()
throws MaryConfigurationException
MaryConfigurationException
public void applyTo(java.util.List<org.w3c.dom.Element> elements)
throws MaryConfigurationException
elements - Elements for which to predict the values
MaryConfigurationException - if attribute values cannot be predicted because of an invalid voice configuration
public void applyFromTo(java.util.List<org.w3c.dom.Element> predictFromElements,
java.util.List<org.w3c.dom.Element> applyToElements)
throws MaryConfigurationException
predictFromElements - Elements from which to predict the valuesapplyToElements - Elements to which to apply the values predicted by this Model
MaryConfigurationException - if attribute values cannot be predicted because of an invalid voice configurationprotected java.util.List<Target> getTargets(java.util.List<org.w3c.dom.Element> elements)
PHONE elements, return a list of Targets, where each Target is constructed from the
corresponding Element.
elements - List of Elements
protected abstract float evaluate(Target target)
throws java.lang.Exception
target -
java.lang.Exception - if the target value cannot be predictedpublic java.lang.String getDataFileName()
public java.lang.String getFeatureName()
public java.lang.String getTargetAttributeName()
public java.lang.String getPredictFrom()
public java.lang.String getApplyTo()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||