Grammar defaults
Voice Platform offers two methods for specifying parameter values at the grammar level:
- The <meta> element—You can use the <meta> element of GrXML to specify a parameter value within a grammar.
- Parameter grammars—A parameter grammar is an XML document that assigns values to recognition parameters. These values apply when the parameter grammar is specified in a <grammar> element in VoiceXML.
The <meta> element
You can specify a value for a parameter within a grammar itself by including the parameter name and the value to be assigned to it in a <meta> element:
<meta name="completetimeout" content="1500"/>
This value applies whenever the grammar is invoked, unless another value for the parameter is specified at a level with higher precedence—in a grammar that imports the current grammar, in a parameter grammar, or in VoiceXML.
A conflict may also arise if the same parameter is set in two or more grammars being used in parallel. In this case, the way Voice Platform handles the conflict depends on the parameter itself.
The parameters that can be set in a <meta> element fall into two categories: compilation-time parameters, and recognition-time parameters.
Since the application of any parameter value set in a <meta> element is so dependent on the context in which that grammar is used, you may override the value accidentally if you are not careful.
Compilation-time parameters
The compilation-time parameters settable in a <meta> element in a grammar include:
|
Parameter |
Type |
Description |
|---|---|---|
|
swirec_compile_parser |
Boolean |
Specifies whether to insert the internal grammar parser into the output binary when the grammar itself is compiled. |
|
swirec_first_pass_grammar |
String |
Specifies a file defining a Statistical Language Model (SLM). |
|
swirec_fsm_grammar |
String |
Specifies a finite state machine (fsm) for a speech grammar. |
|
swirec_fsm_wordlist |
String |
Specifies a wordlist used by a speech grammar. |
|
swirec_max_dict_prons |
Integer |
Specifies the maximum number of pronunciations per word. |
|
swirec_multiword_replace |
Boolean |
Limits the pronunciations per phrase in user dictionaries. |
|
swirec_normalize_to_probabilities |
Boolean |
Adds a normalized, probabilistic language model to an SLM. |
|
swirec_optimization |
Integer |
Specifies the optimization level for the grammar. |
|
swirec_training_grammar |
String |
Specifies an SLM training set. |
Recognition-time parameters
The recognition-time parameters settable in a <meta> element in a grammar include:
|
Parameter |
Type |
Description |
|---|---|---|
|
completetimeout |
Integer |
Specifies milliseconds to wait before assuming the end of caller speech if the current utterance is recognizable. |
|
incompletetimeout |
Integer |
Specifies milliseconds to wait before assuming the end of caller speech if the current utterance is not recognizable. |
|
maxspeechtimeout |
Integer |
Sets maximum duration for an utterance, in milliseconds. |
|
secure_context |
String |
Applies security measures to protect sensitive data. |
|
swirec_acoustic_adapt_suppress_adaptation |
Boolean |
Controls the Recognizer acoustic adaptation function. |
|
swirec_app_state_tokens |
String |
Adds platform- or application-specific information to call logs. |
|
swirec_astar_max_paths |
Integer |
Specifies a maximum nodes visited during an a-star search. |
|
swirec_company_name |
String |
Specifies a company name to be associated with a session. |
|
swirec_lmweight |
Float |
Weights language models relative to acoustic models. |
|
swirec_max_arcs |
Integer |
Specifies maximum number of active finite state machine arcs. |
|
swirec_max_cpu_time |
Integer |
Sets maximum time the Recognizer spends on a recognition. |
|
swirec_max_logged_nbest |
Integer |
Specifies maximum n-best entries logged in call log. |
|
swirec_max_parses_per_literal |
Integer |
Sets the maximum number of interpretations evaluated by the Recognizer for a single literal string in the grammar. |
|
swirec_phoneme_lookahead_beam |
Float |
Guides the Viterbi beam search. |
|
swirec_return_waveform |
Boolean |
Controls whether waveforms are returned with recognitions. |
|
swirec_silence_prune_offset |
Float |
Specifies limits for search paths ending in silence. |
|
swirec_simple_result_key |
String |
Specifies a single key to be returned in the recognition result. |
|
swirec_state_beam |
Float |
Sets main parameter guiding the Viterbi beam search. |
|
swirec_word_confidence_enabled |
Boolean |
Specifies whether to perform word confidence calculations. |
Parameter grammars
A parameter grammar is an XML text file that assigns values for the Recognizer to use for various recognition parameters.
When the application loads and activates a parameter grammar, the Recognizer applies the parameter values from the file to recognition. The parameters remain set as long as the parameter grammar is activated. The values can be overridden only by a parameter passed from VoiceXML, or by a parameter grammar that has higher precedence.
You can use a parameter grammar directly on a VoiceXML page:
<field name="x">
<grammar src="http//www.company.com/paramgram.xml">
<grammar src="./realgrammar.grxml">
</field>
In this example, paramgram.xml is the parameter grammar, while realgrammar.grxml is the GrXML grammar defining the words that can be recognized.
The parameters that can be included in a parameter grammar include:
|
Parameter |
Type |
Description |
|---|---|---|
|
completetimeout |
Integer |
Specifies milliseconds to wait before assuming the end of caller speech if the current utterance is recognizable. |
|
incompletetimeout |
Integer |
Specifies milliseconds to wait before assuming the end of caller speech if the current utterance is not recognizable. |
|
maxspeechtimeout |
Integer |
Sets maximum duration for an utterance, in milliseconds. |
|
secure_context |
Boolean |
Suppresses sensitive information from call logs. |
|
sensitivity |
Float |
Controls speech detector sensitivity when looking for speech. |
|
swirec_acoustic_adapt_suppress_adaptation |
Boolean |
Controls the Recognizer acoustic adaptation function. |
|
swirec_app_state_tokens |
String |
Adds platform- or application-specific information to call logs. |
|
swirec_barge_in_mode |
String |
Sets special recognition modes in the recognizer. |
|
swirec_company_name |
String |
Specifies a company name to be associated with a session. |
|
swirec_extra_nbest_keys |
String |
Adds one or more grammar keys to the XML result. |
|
swirec_grammar_script |
String |
Specifies a script to be used with grammars that use Nuance scripts (tag-format "swi-semantics/1.0”). |
|
swirec_grammar_script_sisr |
String |
Specifies a script to be used with grammars that use W3C scripts (tag-format "semantics/1.0” or "semantics/1.0-literals"). |
|
swirec_load_adjusted_cpu_ranges |
Integer |
Defines ranges of system CPU activity (idle, normal, busy). |
|
swirec_load_adjusted_speedvsaccuracy |
String |
Balances system speed relative to recognition accuracy. |
|
swirec_magic_word_conf_thresh |
Integer |
Specifies confidence score required to recognize a hot word. |
|
swirec_max_arcs |
Integer |
Specifies maximum number of active finite state machine arcs. |
|
swirec_max_cpu_time |
Integer |
Sets maximum time the Recognizer spends on a recognition. |
|
swirec_max_logged_nbest |
Integer |
Specifies maximum n-best entries logged in call log. |
|
swirec_max_parses_per_literal |
Integer |
Sets the maximum number of interpretations evaluated by the Recognizer for a single literal string in the grammar. |
|
swirec_max_search_time |
Integer |
Sets the maximum duration of the search phase of recognition. |
|
swirec_max_sentences_tried |
Integer |
Sets maximum candidates considered for n-best list. |
|
swirec_nbest_list_length |
Integer |
Specifies maximum number of n-best answers returned. |
|
swirec_phoneme_lookahead_beam |
Float |
Guides the Viterbi beam search. |
|
swirec_return_waveform |
Boolean |
Controls whether waveforms are returned with recognitions. |
|
swirec_selective_barge_in_conf_thresh |
Integer |
Sets the minimum confidence score for recognition results computed during a selective barge-in. |
|
swirec_silence_prune_offset |
Float |
Specifies limits for search paths ending in silence. |
|
swirec_state_beam |
Float |
Sets main parameter guiding the Viterbi beam search. |
|
swirec_waveform_begin_silence |
Integer |
Specifies milliseconds of leading silence in waveforms. |
|
swirec_word_confidence_enabled |
Boolean |
Specifies whether to perform word confidence calculations. |
|
swissm_confidence_threshold |
Float |
Sets confidence threshold for SSMs. |