Below is my simple US state grammar code. My problem is that when I say like "America"
it gives me "Connecticut" or a valid state even the word "America" is not in my grammar.
When a word is not in the grammar it should say like "Sorry I didn't understand you".
Is this something to do with my confidencelevel parameter? The biggest concern is what if the user
is a truck driver and inside the truck is very noisy what will be then the best properties?
1 <?xml version="1.0"?>
2 <!DOCTYPE vxml PUBLIC "-//The Plum Group//DTD VOICEXML 2.1//EN" "/usr/local/plumvp/vxml.dtd">
3 <vxml version="2.0">
4 <property name="sensitivity" value="0.2"/>
5 <property name="interdigittimeout" value="3s"/>
6 <property name="confidencelevel" value="0.65"/>
7 <property name="incompletetimeout" value="3s"/>
8 <property name="timeout" value="5s"/>
9 <property name="inputmodes" value="dtmf"/>
10 <form id="user_input_us_state">
11 <field name="usstate">
12 <grammar type="application/x-jsgf" mode="voice">
13 Alabama|Alaska| Arizona| Arkansas| California| Colorado|
14 Connecticut| Delaware | District of Columbia| Florida|
15 Georgia| Hawaii| Idaho| Illinois| Indiana| Iowa| Kansas|
16 Kentucky| Louisiana| Maine| Maryland| Massachusetts|
17 Michigan| Minnesota| Mississippi| Missouri| Montana|
18 Nebraska| Nevada| New Hampshire| New Jersey| New Mexico
19 | New York| North Carolina| North Dakota| Ohio|
20 Oklahoma| Oregon| Pennsylvania| Rhode Island| South
21 Carolina| South Dakota| Tennessee| Texas| Utah| Vermont|
22 Virginia| Washington| West Virginia| Wisconsin| Wyoming
23 </grammar>
24 <prompt bargein="false">
25 <value expr="say your state"/>
26 </prompt>
27 <filled>
28 <prompt>
29 <value expr="usstate"/>
30 </prompt>
31 </filled>
32 </field>
33 </form>
34 </vxml>
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
re: US state voice recognition
Re: re: US state voice recognition
Hi,
We've tested your code and noticed a few things. One, you are using the following line in your code:
Since you are trying to read voice prompts, you'd want to either change the mode to "voice," or just remove this line altogether.
Testing with this code change, we found that the application behaved as expected, however, to maximize consistency, we do recommend using grammar type srgs rather than jsgf whenever possible. Using srgs, your application code would look something like this:
This code passed tests 100% of the time for both valid and invalid input, eg., saying "Arkansas" returned "Arkansas," and saying "America" returned "Sorry, I didn't understand you."
Hope this helps.
Regards,
Plum Support
We've tested your code and noticed a few things. One, you are using the following line in your code:
Code: Select all
<property name="inputmodes" value="dtmf"/>
Testing with this code change, we found that the application behaved as expected, however, to maximize consistency, we do recommend using grammar type srgs rather than jsgf whenever possible. Using srgs, your application code would look something like this:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form id="mainmenu">
<field name="usstate">
<grammar type="application/srgs+xml" root="ROOT" mode="voice">
<rule id="ROOT">
<one-of>
<item>Arkansas</item>
<item>Alabama</item>
<item>Arizona</item>
</one-of>
</rule>
</grammar>
<prompt>
Say your state
</prompt>
<filled>
<prompt>
<value expr="usstate"/>
</prompt>
</filled>
</field>
</form>
</vxml>
Hope this helps.
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: re: US state voice recognition
Thank you so much!