共用方式為


SemanticValue.Confidence 屬性

定義

傳回確定性的相對量值,這是與傳回目前 SemanticValue 執行個體的語意剖析正確性有關。

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

屬性值

Single

傳回 float,這是傳回目前 SemanticValue 執行個體的語意剖析確定性的相對量值。

範例

下列範例是用來以遞迴方式進行,然後顯示資訊 (包括信賴) 做為 TreeNodeCollection ,或做為節點組成用來辨識片語之語義的樹狀結構。

internal static void CreateSemanticsTreeNodes(  
        TreeNodeCollection nodes,  
        SemanticValue semantics,  
        String name)   
{  
  string semanticsText =   
      String.Format("  {0}  (Confidence {1})", name,semantics.Confidence);  

  // Format integers as hexadecimal.  
  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);  
  }  
  nodes.Add(semanticsNode);  
}  

備註

傳回 SemanticValue.Confidence 語義剖析正確性值的屬性不應與屬性混淆,後者會傳回 RecognizedPhrase.Confidence 語音辨識的精確度量值。

適用於