swirec_normalize_to_probabilities

Improves accuracy by adding a normalized, probabilistic language model.

Value

Boolean

Default

0 (normalization is off)

How to set

In a grammar using a <meta> tag. See the text on compilation-time parameters in Parameters set in grammar files.

Usage

This is an advanced tuning feature for speech grammar developers to improve accuracy.

Use it for subgrammars when the parent grammar has a language model (for example, when the parent is an advanced natural language grammar as described in Adding natural language capabilities).

Most often used with SLMs, but can improve accuracy of other grammars.

Performance

After changing the value, evaluate the effect on runtime processing latency before applying the change to a production system.

This parameter improves the recognition accuracy of a Statistical Language Model (SLM) by adding a normalized, probabilistic language model to all grammar classes. Always set this parameter to 1 in grammars referenced by an SLM.

For a language model to be usable as a grammar class, the sum of all probabilities of all sentences generated by the grammar must equal 1. Normally the compiled FSM is scaled to the cheapest cost is set to zero, which is not good when importing to an SLM. Thus, when this parameter is set, the grammar’s compilation changes as follows:

  1. For each <one-of> element in the grammar, the weights of all items will be normalized such that they add to 1. If an item does not have a weight attribute, it is treated as if the weight were set to 1.0.
  2. For each repeated <item> that does not have a repeat-prob attribute, the compiled grammar will have the same probability for any number of repetitions.
  3. For each repeated <item> that already has a repeat probability, the probability will not be changed.

To ensure this parameter takes effect in a sub-grammar, pre-compile the sub-grammar and use it as a *.gram file.

Here is a partial grammar containing weighted items:

<one-of>
<item weight="1.0"> zero </item>
<item weight="0.2"> oh </item>
<item> one </item>
</one-of>

Assuming the grammar also sets this parameter, the relative frequencies determined during compilation are:

zero1.0/2.2 = 0.4545

oh0.2/2.2 = 0.0909

one1.0/2.2 = 0.4545

After compilation, the internal representation of the grammar would be:

<one-of>
<item weight="0.4545"> zero </item>
<item weight="0.0909"> oh </item>
<item weight="0.4545"> one </item>
</one-of>

Because built-in grammars are precompiled, you cannot set this parameter inside those grammars. However, you can set the parameter in a wrapper grammar that specifies weights:

<rule id="myDate">
<one-of>
<item weight="0.001">
<ruleref uri="builtin:grammar/date"/>
</item>
</one-of>
</rule>