edu.cmu.sphinx.result
Interface ConfidenceScorer

All Known Implementing Classes:
MAPConfidenceScorer, SausageMaker

public interface ConfidenceScorer

Computes confidences for a Result. Typically, one is interested in the confidence of the best path of a result, as well as the confidence of each word in the best path of a result. To obtain this information, one should do the following:


 ConfidenceScorer scorer = (ConfidenceScorer) ... // obtain scorer from configuration manager

 Result result = recognizer.recognize();
 ConfidenceResult confidenceResult = scorer.score(result);

 // confidence for best path
 Path bestPath = confidenceResult.getBestHypothesis();
 double pathConfidence = bestPath.getConfidence();

 // confidence for each word in best path
 WordResult[] words = bestPath.getWords();
 for (int i = 0; i < words.length; i++) {
     WordResult wordResult = (WordResult) words[i];
     double wordConfidence = wordResult.getConfidence();
 }

 

Note that different ConfidenceScorers have different definitions for the 'best path', and therefore their getBestHypothesis methods will return different things. The MAPConfidenceScorer returns the highest scoring path. On the other hand, the SausageMaker returns the path where all the words have the highest confidence in their corresponding time slot.


Method Summary
 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.
 

Method Detail

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.

Parameters:
result - the result to compute confidences for
Returns:
a confidence result