ConfidenceScorer API

<span style="font-size:24px;">public interface ConfidenceScorer extends Configurable
爲一個結果result計算自信度得分後驗概率。一般感興趣的僅是在一個結果的最好路徑的自信度。以及在最好路徑上的每一個字的自信度。爲了獲得這信息,一般採用以下步驟:
 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();
  }
注意:不同的自信度得分器對最好路徑有着不同的定義,因此它們的getBestHypothesis方法將會返回不同的東西。如:MAPConfidenceScorer返回的是最高得分的路徑。SausageMaker返回的路徑爲所有字在它們相應的時間間隔內都有着最高的自信度。
  public ConfidenceResult score(Result result);爲一個結果計算其自信度,返回的是一個confidenceresult對象,在結果中的所有假設的緊湊的表示每一個字和每一路徑的自信度。</span>

發佈了43 篇原創文章 · 獲贊 9 · 訪問量 65萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章