edu.cmu.sphinx.result
Class MAPConfidenceScorer

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

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

Computes confidences for the highest scoring path in a Result. The highest scoring path refers to the path with the maximum a posteriori (MAP) probability, which is why this class is so named. Note that this MAPConfidenceScorer creates a Lattice from the result first, which means that you should only use this confidence scorer if the result is created from the LexTreeLinguist and the WordPruningBreadthFirstSearchManager.


Field Summary
static java.lang.String PROP_DUMP_LATTICE
          Sphinx property that specifies whether to dump the lattice.
static boolean PROP_DUMP_LATTICE_DEFAULT
          The default value of PROP_DUMP_LATTICE.
static java.lang.String PROP_DUMP_SAUSAGE
          Sphinx property that specifies whether to dump the sausage.
static boolean PROP_DUMP_SAUSAGE_DEFAULT
          The default value of PROP_DUMP_SAUSAGE.
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
MAPConfidenceScorer()
           
 
Method Summary
 java.lang.String getName()
          Retrieves the name for this configurable component
 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

PROP_DUMP_LATTICE

public static final java.lang.String PROP_DUMP_LATTICE
Sphinx property that specifies whether to dump the lattice.

See Also:
Constant Field Values

PROP_DUMP_LATTICE_DEFAULT

public static final boolean PROP_DUMP_LATTICE_DEFAULT
The default value of PROP_DUMP_LATTICE.

See Also:
Constant Field Values

PROP_DUMP_SAUSAGE

public static final java.lang.String PROP_DUMP_SAUSAGE
Sphinx property that specifies whether to dump the sausage.

See Also:
Constant Field Values

PROP_DUMP_SAUSAGE_DEFAULT

public static final boolean PROP_DUMP_SAUSAGE_DEFAULT
The default value of PROP_DUMP_SAUSAGE.

See Also:
Constant Field Values
Constructor Detail

MAPConfidenceScorer

public MAPConfidenceScorer()
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

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.

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

score

public 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.

Specified by:
score in interface ConfidenceScorer
Parameters:
result - the result to compute confidences for
Returns:
a confidence result