SemanticValue.Confidence 属性

定义

返回有关返回 SemanticValue 的当前实例的语义分析的正确性的某个相对度量。Returns a relative measure of the certainty as to the correctness of the semantic parsing that returned the current instance of SemanticValue.

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

属性值

返回某个返回 SemanticValue 的当前实例的语义分析的相对度量的 floatReturns a float that is a relative measure of the certainty of semantic parsing that returned the current instance of SemanticValue.

示例

下面的示例用于以递归方式遍历并显示信息 (包括置信度) TreeNodeCollection, 或用作构成用于识别短语的语义树结构的节点。The following example is used to recursively traverse and then display information (including confidence) as a TreeNodeCollection, or as the nodes making up the tree structure of the semantics used to recognize a phrase.

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);  
}  

注解

属性 (返回语义分析的正确性的度量值) 不应RecognizedPhrase.Confidence与属性混淆, 后者将返回语音识别的准确性度量值。 SemanticValue.ConfidenceThe SemanticValue.Confidence property, which returns a measure of the correctness of semantic parsing, should not be confused with the RecognizedPhrase.Confidence property, which returns a measure of the accuracy of speech recognition.

适用于