SemanticValue.Confidence Property

Returns a relative measure of the certainty as to the correctness of the semantic parsing that returned the current instance of SemanticValue.

Namespace: System.Speech.Recognition
Assembly: System.Speech (in system.speech.dll)

public float Confidence { get; }
/** @property */
public float get_Confidence ()

public function get Confidence () : float

Not applicable.

Property Value

Returns a float a relative measure of the certainty of correct recognition for the phrase information returned in the current SemanticValue instance.

The values returned by Confidence are purely relative and unique to each recognition engine.

There is no definition how confidence values between two different recognition engines compare.

The values are used to rank alternative candidate phrases returned by the Alternates property on RecognitionResult objects.

The example below is used to recursively traverse and then display (as a System.Windows.Forms.TreeNodeCollection) information, including confidence, or the nodes making up the tree structure of the semantics used to recognize a phrase. The use of Confidence is highlighted.

internal static void CreateSemanticsTreeNodes(TreeNodeCollection nodes,
                                              SemanticValue semantics,
                                              String name) {
       //Put integers as hex
    if (semantics.Value == null ){
        semanticsText = semanticsText + " = null";
    }else if (semantics.Value.GetType() == typeof(int)) {
        semanticsText = String.Format("{0} = {1:X} ", 
                                      semanticsText, semantics.Value);
    } else {
        semanticsText = semanticsText + " = "
                       + semantics.Value.ToString();
    TreeNode semanticsNode = new TreeNode(semanticsText);
    foreach (KeyValuePair<String, SemanticValue> child in semantics) {
        CreateSemanticsTreeNodes(semanticsNode.Nodes, child.Value, child.Key);
    //   }

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0