CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechPhraseProperty

Confidence Property


The Confidence property returns the confidence value for this semantic property computed by SAPI or the speech recognition engine.

It is an enumerated value of type SpeechEngineConfidence. See Confidence Scoring and Rejection in SAPI Speech Recognition Engine Guide for additional details.


Syntax

Set: (This property is read-only)
Get: SpeechEngineConfidence = ISpeechPhraseProperty.Confidence

Parts

ISpeechPhraseProperty
The owning object.
SpeechEngineConfidence
Set: (This property is read-only)
Get: A SpeechEngineConfidence variable that gets the property.

Remarks

It is possible to have different confidences for each rule name. This would be the result of pronunciation, background noise, or accent.

Example

The following code demonstrates getting the Confidence property from a command and control recognition. One label displays the recognized text and the other label displays the rule name activated as well as the confidence associated with that recognition.

To run this code, create a form with the following controls:

  • Two labels called Label1 and Label2
  • Paste this code into the Declarations section of the form.

    The Form_Load procedure creates and activates a command and control grammar. The grammar file sol.xml is the solitaire grammar with the SDK. The path listed is for a standard SDK install and may be changed as needed.

    If "play the red five" has been recognized, the application displays the recognized text in Label1. Label2 displays the rule name and the confidence for that recognition. In this case, the rules would be "color" and "rank" along with their confidence values.

    Option Explicit
    Public WithEvents RC As SpSharedRecoContext
    Public myGrammar As ISpeechRecoGrammar
    
    Private Sub Form_Load()
        Set RC = New SpSharedRecoContext
        
        Set myGrammar = RC.CreateGrammar
        myGrammar.CmdLoadFromFile "C:\Program Files\Microsoft Speech SDK 5.1\Samples\Common\sol.xml", SLODynamic
        myGrammar.CmdSetRuleIdState 0, SGDSActive
    End Sub
    
    Private Sub RC_FalseRecognition(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal Result As SpeechLib.ISpeechRecoResult)
        Beep
        Label1.Caption = "(no recognition)"
        Label2.Caption = ""
    End Sub
    
    Private Sub RC_Recognition(ByVal StreamNumber As Long, ByVal StreamPosition As Variant, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal Result As SpeechLib.ISpeechRecoResult)
        Dim i As Long
        
        Label1.Caption = Result.PhraseInfo.GetText & vbCrLf
        
        Label2.Caption = "Rule Properties Found : " & Result.PhraseInfo.Properties.Count & vbCrLf
        For i = 0 To Result.PhraseInfo.Properties.Count - 1
            Label2.Caption = Label2.Caption & Result.PhraseInfo.Properties.Item(i).Name
            Label2.Caption = Label2.Caption & " Confidence : " & Result.PhraseInfo.Properties.Item(i).Confidence & vbCrLf
        Next
    End Sub
    


    You are reading help file online using chmlib.com

    If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
    Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web