edu.cmu.sphinx.result
Class SausageMaker

java.lang.Object
  extended byedu.cmu.sphinx.result.SausageMaker
All Implemented Interfaces:
ConfidenceScorer, Configurable

public class SausageMaker
extends java.lang.Object
implements ConfidenceScorer, Configurable

The SausageMaker takes word lattices as input and turns them into sausages (Confusion Networks) according to Mangu, Brill and Stolcke, "Finding Consensus in Speech Recognition: word error minimization and other applications of confusion networks", Computer Speech and Language, 2000. Note that the getBestHypothesis of the ConfidenceResult object returned by the score method returns the path where all the words have the highest posterior probability within its corresponding time slot.

Author:
pgorniak

Field Summary
static java.lang.String PROP_LANGUAGE_WEIGHT
          Sphinx property that defines the language model weight.
static float PROP_LANGUAGE_WEIGHT_DEFAULT
          The default value for the PROP_LANGUAGE_WEIGHT property
 
Constructor Summary
SausageMaker()
          Construct an empty sausage maker
SausageMaker(Lattice l)
          Construct a sausage maker
 
Method Summary
 java.lang.String getName()
          Retrieves the name for this configurable component
 Sausage makeSausage()
          Turn the lattice contained in this sausage maker into a sausage object.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 ConfidenceResult score(Result result)
          Computes confidences for a Result and returns a ConfidenceResult, a compact representation of all the hypothesis contained in the result together with their per-word and per-path confidences.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_LANGUAGE_WEIGHT

public static final java.lang.String PROP_LANGUAGE_WEIGHT
Sphinx property that defines the language model weight.

See Also:
Constant Field Values

PROP_LANGUAGE_WEIGHT_DEFAULT

public static final float PROP_LANGUAGE_WEIGHT_DEFAULT
The default value for the PROP_LANGUAGE_WEIGHT property

See Also:
Constant Field Values
Constructor Detail

SausageMaker

public SausageMaker()
Construct an empty sausage maker


SausageMaker

public SausageMaker(Lattice l)
Construct a sausage maker

Parameters:
l - the lattice to construct a sausage from
Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Parameters:
name - the name of the component
registry - the registry for this component
Throws:
PropertyException
See Also:
Configurable.register(java.lang.String, edu.cmu.sphinx.util.props.Registry)

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.
See Also:
Configurable.newProperties(edu.cmu.sphinx.util.props.PropertySheet)

getName

public java.lang.String getName()
Description copied from interface: Configurable
Retrieves the name for this configurable component

Specified by:
getName in interface Configurable
Returns:
the name
See Also:
Configurable.getName()

makeSausage

public Sausage makeSausage()
Turn the lattice contained in this sausage maker into a sausage object.

Returns:
the sausage producing by collapsing the lattice.

score

public ConfidenceResult score(Result result)
Description copied from interface: ConfidenceScorer
Computes confidences for a Result and returns a ConfidenceResult, a compact representation of all the hypothesis contained in the result together with their per-word and per-path confidences.

Specified by:
score in interface ConfidenceScorer
Parameters:
result - the result to compute confidences for
Returns:
a confidence result
See Also:
ConfidenceScorer.score(edu.cmu.sphinx.result.Result)