RecognizedPhrase.Confidence プロパティ

定義

RecognizedPhrase が特定の入力と一致する確率を表す値 (認識エンジンによって割り当てられます) を取得します。

public:
 property float Confidence { float get(); };
public float Confidence { get; }
member this.Confidence : single
Public ReadOnly Property Confidence As Single

プロパティ値

語句の正しい認識の確実性の相対測定値。 値は 0.0 から 1.0 までであり、低い数字ほど信頼度が低くなります。

次の例は、または Grammar.SpeechRecognized イベントのハンドラーをSpeechRecognitionEngine.SpeechRecognizedSpeechRecognizer.SpeechRecognized示しています。 この例では、 オブジェクトに関連付けられている情報を RecognitionResult 示しています。その一部は から RecognizedPhrase派生しています。 ハンドラーは、認識されたフレーズの信頼度スコアと認識代替候補を表示します。

void SpeechRecognizedHandler(object sender, SpeechRecognizedEventArgs e)  
{  
  if (e.Result == null) return;  

  // Add event handler code here.  

  // The following code illustrates some of the information available  
  // in the recognition result.  
  Console.WriteLine("Recognition result summary:");  
  Console.WriteLine(  
    "  Recognized phrase: {0}\n" +   
    "  Confidence score {1}\n" +   
    "  Grammar used: {2}\n",   
    e.Result.Text, e.Result.Confidence, e.Result.Grammar.Name);  

  // Display the semantic values in the recognition result.  
  Console.WriteLine("  Semantic results:");  
  foreach (KeyValuePair<String, SemanticValue> child in e.Result.Semantics)  
  {  
    Console.WriteLine("    The {0} city is {1}",  
      child.Key, child.Value.Value ?? "null");  
  }  
  Console.WriteLine();  

  // Display information about the words in the recognition result.  
  Console.WriteLine("  Word summary: ");  
  foreach (RecognizedWordUnit word in e.Result.Words)  
  {  
    Console.WriteLine(  
      "    Lexical form ({1})" +  
      " Pronunciation ({0})" +  
      " Display form ({2})",  
      word.Pronunciation, word.LexicalForm, word.DisplayAttributes);  
  }  

  // Display information about the audio in the recognition result.  
  Console.WriteLine("  Input audio summary:\n" +  
    "    Candidate Phrase at:       {0} mSec\n" +  
    "    Phrase Length:             {1} mSec\n" +  
    "    Input State Time:          {2}\n" +  
    "    Input Format:              {3}\n",  
    e.Result.Audio.AudioPosition,  
    e.Result.Audio.Duration,  
    e.Result.Audio.StartTime,  
    e.Result.Audio.Format.EncodingFormat);  

  // Display information about the alternate recognitions in the recognition result.  
  Console.WriteLine("  Alternate phrase collection:");  
  foreach (RecognizedPhrase phrase in e.Result.Alternates)  
  {  
    Console.WriteLine("    Phrase: " + phrase.Text);  
    Console.WriteLine("    Confidence score: " + phrase.Confidence);  
  }  
}  

注釈

信頼度スコアは、語句が正しく認識された絶対確率を示すものではありません。 代わりに、信頼度スコアは、特定の入力に対する複数の認識代替の相対的な精度を比較するためのメカニズムを提供します。 これにより、最も正確な認識結果が返されます。 たとえば、認識された語句の信頼度スコアが 0.8 の場合、その語句が入力に対して正しく一致する可能性が 80% であることを意味するものではありません。 つまり、語句は、信頼度スコアが 0.8 未満の他の結果よりも、入力に対して正しい一致である可能性が高くなります。

同じ認識操作または同じ入力の以前の認識から比較する別の結果がない限り、信頼度スコア自体は意味がありません。 値は、オブジェクトの プロパティRecognitionResultによって返される代替候補フレーズをAlternatesランク付けするために使用されます。

信頼度の値は、各認識エンジンに対して相対的で一意です。 2 つの異なる認識エンジンによって返される信頼度値を意味のある比較することはできません。

音声認識エンジンは、バックグラウンド干渉、音声の非アーティキュレート、予期しない単語または単語シーケンスなど、さまざまな理由で、音声入力に低信頼度スコアを割り当てることができます。 アプリケーションで インスタンスを SpeechRecognitionEngine 使用している場合は、いずれかのメソッドを使用して、音声入力が受け入れられるか拒否される信頼度レベルを UpdateRecognizerSetting 変更できます。 によって SpeechRecognizer管理される共有認識エンジンの信頼度しきい値は、ユーザー プロファイルに関連付けられて、Windows レジストリに格納されます。 アプリケーションは、共有認識エンジンのプロパティの変更をレジストリに書き込むべきではありません。

オブジェクトの RecognitionResult プロパティにはAlternates、オブジェクトのRecognizedPhrase順序付けられたコレクションが含まれています。各オブジェクトは、認識エンジンへの入力に一致する可能性があります。 代替候補は、信頼度が最も高いものから最も低い順に並べ替えられます。

適用対象

こちらもご覧ください