Purpose
This post is intended to provide additional clarifications regarding the use and limitations of speech adaptation boost and class tokens with the following UniMRCP server plugins:
Speech Adaptation Boost
To start off, even in the latest Google APIs, speech adaptation boost is available only for Dialogflow v2. For Speech-to-Text, this feature is still available in v1b1beta1, but not v1. That is why the approach discussed in this post is currently applicable to GDF only. The same approach would be applicable to GSR in the future when Google makes this feature available in v1 and we have the Google APIs upgraded.
Boost values can be set in a speech context defined in the configuration file by using the attribute name weight or boost, for example, as follows. Note the two attribute names can be used interchangeably.
<speech-context id="custom" enable="true">
<phrase weight="15">fair</phrase>
<phrase weight="2">fare</phrase>
</speech-context>
The same can be specified via SRGS XML by using the attribute name weight, for example, as follows.
<grammar xmlns="
http://www.w3.org/2001/06/grammar" xml:lang="en-US" version="1.0" mode="voice" root="custom">
<rule id="custom">
<one-of>
<item
weight="15">fair</item>
<item
weight="2">fare</item>
</one-of>
</rule>
</grammar>
Refer to recommendations from Google for best practices on setting up boost values:
Class Tokens
Class tokens can be used with both GSR and GDF. The following is a sample speech context defined in the configuration file which make use of the class token $TIME.
<speech-context id="time" language="en-US" enable="false">
<phrase>$TIME</phrase>
</speech-context>
The specified speech context can be referenced via a built-in grammar as follows.
builtin:speech/time
or
builtin:grammar/time
The same cab be specified via SRGS XML as follows
<grammar xmlns="
http://www.w3.org/2001/06/grammar" xml:lang="en-US" version="1.0" mode="voice" root="custom">
<meta name="scope" content="hint"/>
<rule id="custom">
<one-of>
<item>$TIME</item>
</one-of>
</rule>
</grammar>
Refer to the following page for the list of available class tokens:
Questions and suggestions are welcome.