An Example Script Algorithm Used With Generic Recognition

Note

This algorithm does not describe all the input and output parameters, only the ones relevant to demonstrate n-best recognition.

Procedure


Step 1

Use the Generic Recognition step.

Input: UserGrammar (for example, An Example Grammar Used With Generic Recognition.)

Output: resultData (a private variable that contains the recognition result) resultCount (the number of results in the resultData)

Step 2

Set integer i = 0. This variable is used to index into the resultData and varies from 0 to one less than the number of results obtained in step 1.

Step 3

While (i)

  1. Use Get Recognition Result Info step

  2. Input: ResultData (data from step 1) i (used to index into the ResultData.

  3. Output: Utterance (text representing what was spoken), ConfLevel (indicates how closely this recognition matches the spoken word) interpCount (indicates number of interpretations in the result)

  4. Set integer j = 0. This variable is used to index into the result to retrieve the interpretations

  5. while (j) (1) Use Get Recognition Interpretation Step (2) Input:       resultData (data from step 1)       i (used to index into resultData)       j (interpretation index) (3) Output:       If slots are defined in the grammar, their values get stored       in the specified variables (4) Set j = j+1

  6. Set i = i+1

Step 4

End.

With the example grammar and example script logic as described in this section and the preceding one, if a customer says "cisco", the customer may get back a recognition result containing three results: "cisco", "tisco" and "misco" respectively. Each of these results represents a different utterance and can have a different confidence level.

Note

The output can vary depending on how the utterance (the word) was spoken and the value of the confidence level configured in the Generic Recognition step.