Enabling n-best
By default, the size of the application.lastresult$ array is just 1, so only the top-ranked interpretation is returned to the application. To make other interpretations available for n-best processing, you must increase the size of the array. You do this by setting the value of one of the following properties:
- maxnbest: Allows you to generate multiple interpretations when there is acoustic ambiguity in the recognition results (for example, in some directory grammars—”Rob Smith, Rod Smith” or “Caroline Savage, Carolyn Savage”).
- maxinterpretations: Allows you to generate multiple interpretations only for ambiguous natural language results.
The size of application.lastresult$ array will be greater than or equal to one, and less than or equal to the system property maxnbest or maxinterpretations. If no results have been generated by the system, then application.lastresult$ will be ECMAScript undefined.
For example, you could set the maxnbest property as follows:
<property name="maxnbest" value="5"/>
Then for each recognition, the recognition service will provide a list of up to five interpretations, ranked from highest to lowest likelihood.