the first step is to construct a grammar that contains all of the matches you want. Here is a sample that declares a few state abbreviations:
Code: Select all
<grammar type="application/srgs+xml" root="root" mode="voice">
<rule id="root">
<one-of>
<item>a are</item> <!--AR = Arkansas -->
<item>cay ess</item> <!--KS = Kansas -->
<item>emm a</item> <!- MA = Massachusetts -->
<item>see a</item> <!- CA = California -->
</grammar>
The next step is to write a
<filled> tag that checks the confidence level of the matched grammar and ensures that it is high enough that we can be confident that the values are correct matches. the confidence score ranges from 0.0 being an absolute no match to 0.99 being a near perfect match. In practice values will range from 0.5 to 0.97, with most accurate matches retaining a confidence score of 0.8 or higher. In our IVR example we will be slightly more trusting with the confidence level and allow confidence scores of 0.78 and above to be considered a successfull match. Here is the full conditional statement we use:
Code: Select all
<if cond="answer$.confidence > 0.75">
<if cond="answer == 'emm a'">
Ah ha! you said massachusetts didn't you?
<elseif cond="answer == 'a are'"/>
The state of Arkansas
<elseif cond="answer == 'cay ess'"/>
Kansas is a farming state
<elseif cond="answer == 'see a'"/>
California, the raiders are a crappy team!
</if>
<else/>
<prompt bargein="false">
Sorry I didn't understand what you said.
</prompt>
</if>
Thats all there is to it! You can now go about constructing custom grammars for use with your own IVR applications.
There are a few things to note however:
*For our IVR hosting environment we currently use Sphinx, an open source, freely available Speech Recognition system. The quality is good, but may not be high enough for use in a production IVR application that relies on speech recognition. In this case we generally bundle speechworks ASR, which offers a much greater degree of accuracy for speech recognition applications.
We will be switching the IVR hosting environment to use Speechworks very soon, expect to see news on the support site detailing this exciting transition in the coming weeks.
Here is copy of a sample vxml file, which incorporates all of the above mentioned snippets into one runnable example:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form id="yesno">
<field name="answer">
<grammar type="application/srgs+xml" root="root" mode="voice">
<rule id="root">
<one-of>
<item>a are</item> <!-- Arkansas -->
<item>cay ess</item>
<item>emm a</item>
<item>see a</item>
</one-of> </rule>
</grammar>
<prompt> Please say the state abbreviation</prompt>
<filled>
<if cond="answer$.confidence > 0.75">
<if cond="answer == 'emm a'">
Ah ha! you said massachusetts didn't you?
<elseif cond="answer == 'a are'"/>
The state of Arkansas
<elseif cond="answer == 'cay ess'"/>
Kansas is a farming state
<elseif cond="answer == 'see a'"/>
California, the raiders are a crappy team!
</if>
<else/>
<prompt bargein="false">
Sorry I didn't understand what you said.
</prompt>
</if>
<goto next="#yesno"/>
</filled>
</field>
</form>
</vxml>
Hope this helps!
warm regards,
The Plum Support Staff