| VoiceXML 2.1 Development Guide | Home | Frameset Home |
|
<meta maintainer> declaration for debugging purposes:
<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
<meta name="maintainer" content="yourEmail@here.com"/>
</vxml>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
<meta name="maintainer" content="yourEmail@here.com"/>
<form id="Form1">
<field name="F_1">
<grammar src="MySubGrammar.gsl#FULLNAME" type="text/gsl"/>
<prompt> Who is the greatest B movie actor of all time? </prompt>
<filled namelist="F_1">
<prompt>
wow. who would have thought that <value expr="F_1"/> actually had a fan base?
</prompt>
</filled>
</field>
</form>
</vxml>
FIRSTNAME
[
[elvis] {return("Elvis ")}
[george] {return("George ")}
[elisha] {return("Elisha ")}
[mister] {return("Mr. ")}
]
MIDDLENAME
[
[aaron] {return("Aaron ")}
[see] {return("C. ")}
[cook] {return("Cook ")}
]
LASTNAME
[
[presley] {return("Presley ")}
[scott] {return("Scott ")}
[junior] {return("Jr. ")}
[tee] {return("T ")}
]
<field> upon a sucessful recognition event. Let's dig into that topic now, shall we?
NAME [
(FIRSTNAME:a ?MIDDLENAME:b LASTNAME:c)
{return(strcat($a strcat($b $c)))} ]
NAME [
(FIRSTNAME:a ?MIDDLENAME:b LASTNAME:c)
..
]
{return(strcat($a strcat($b $c)))}
FULLNAME [
NAME:d {<F_1 $d>}
]
NAME [
(FIRSTNAME:a ?MIDDLENAME:b LASTNAME:c)
{return(strcat($a strcat($b $c)))}
]
FIRSTNAME [
[elvis] {return("elvis ")}
[george] {return("George ")}
[elisha] {return("Elisha ")}
[mister] {return("Mr. ")}
]
MIDDLENAME [
[aaron] {return("Aaron ")}
[see] {return("C. ")}
[cook] {return("Cook ")}
]
LASTNAME [
[presley] {return("Presley ")}
[scott] {return("Scott ")}
[junior] {return("Jr. ")}
[tee] {return("T ")}
]
| ANNOTATIONS: EXISTING POSTS |
moshe
|
|
| In order for the "name slot to match up with the return slot", the rule has to start like this:
.FULLNAME [ NAME:d {<F1 $d>} ] and not <MyName $d> as in the example. (And if I'm wrong, could we get an explanation of how the name stot matches up with the return slot?) |
|
eosmann
|
|
| It does appear that "NAME:d {<MyName $d>}" should read "NAME:d {<F_1 $d>}". Correct?
Cheers. |
|
MattHenry
|
|
| Hi guys,
You both are as right as rain; thanks to all for the catch. The corrected version should be posted within the next few days. ~Matt |
|
henryanelson
|
|
| Does the F_1 reference the field name? | |
MattHenry
|
|
|
hello Henry, I am assuming that you are speaking of the top level rule return in the grammar file: FULLNAME [ NAME:d {<F_1 $d>} ] ..which does, in fact, refernce the fieldname. You might check our docs on grammar slots for additional information on this topic: http://docs.voxeo.com/voicexml/2.0/gslslots.htm ~Matt |
|
danielvinson
|
|
| I am attempting to adapt the code such that it recognises a PIN ie 0-9 for between 5-8 digits. It is proving harder than expected. It seem to limit the number of options for each entry to 4. Is this due to the rules?
Regards Daniel |
|
mikethompson
|
|
| Hi Daniel,
You can save yourself a lot of trouble by using our builtin digits grammar for your PIN entry system. You can check out all of our builtin grammars here: http://docs.voxeo.com/voicexml/2.0/gslbuiltins.htm#start Here's a quick example of using type="digits" with a maximum length of 8 and a minimum length of 5. <field name="F_1" type="digits?minlength=5;maxlength=8"> ... <filled> <prompt> your input was <value expr="F_1"/>. </prompt> </filled> </field> Hope this helps, Mike Thompson Voxeo Corporation |
|
danielvinson
|
|
| Hi Mike
Thanks for your reply. What about if I wanted to recognise a postcode (ie a combination of letters and numbers) ? I assume the digits function won't work. What options do I have? Daniel |
|
jbassett
|
|
| Hello,
Alphanumeric is *very* difficult to capture accurately....'B' sounds like 'D' sounds like '3', world without end. I'm not saying that All Hope Is Lost, simply attempting to make it clear that devising such a grammar is going to require some time devoted to testing, tuning, retesting, retuning, rinsing, repeating. Here are some link you might find useful. If you would like to go to our support forums and open a ticket on this, I can give you a alphanumeric grammar example for Canadian zip codes. http://docs.voxeo.com/voicexml/2.0/t_14_mot.htm http://docs.voxeo.com/voicexml/2.0/t_20.htm http://docs.voxeo.com/voicexml/2.0/w3cprops.htm Thanks Jesse Bassett Voxeo Support |
|
danielvinson
|
|
| Hi Jesse
Thanks for the reply. I read that alphanumeric is difficult before. I assume by limiting the number of options for each character will improve the accuracy. Forgetting about the accuracy problems for the moment do you think it is possible to adapt the above code (first, middle and last names) to ask for a postcode? If so can you give me a hint. Thanks Daniel |
|
MattHenry
|
|
|
Daniel, The code that was attached *is* for alphanumeric zip code capture, so I am a bit confused as to your question....please advise as to what I am not understanding. ~Matt |
|
georgelai
|
|
| I was just wondering... instead of using subGrammars, could I resend a voice wav file to a grammar xml file to decode different parts of the wav file?
For example, I have a voice wav file saying... "quick brown fox jumped over the lazy dog" and I have grammar code: PARTOFSENTENCE [ PART:b {<F_1 $b>} ] PART [ (WORD:a) {return($a)} ] WORD [ [quick] {return("quick ")} [fox] {return("fox ")} [brown] {return("brown ")} [jumped] {return("jumped ")} [over] {return("over")} [lazy] {return("lazy")} [dog] {return("dog")} ] If there a way to run the voice wav file through the grammar check so that when the first word "quick" is recognized, then some code would "chop" the wav file and remove "quick" from the wav file (or ignore it), and run the wav again through the grammar to recognize "brown", and etc. So instead of: "quick brown fox jumped" one could potentially also say: "brown dog jumped over lazy fox" and both texts would be converted to text. Maybe I am asking for an impossible approach, but this way a whole sentence could be parsed into text without having discrete positions for words. True, it would be slow for long phrases... |
|
voxeojeff
|
|
| Hello,
Technically, what you are asking for is possible, and would require a complex grammar file. However, before we steer you down this path, we would like to know what exactly you are trying to accomplish here, in detail. If you would be so kind, can you explain the purpose and flow of your application? Thank you, Jeff Menkel Voxeo Corporation |
|
parit
|
|
| hi,
I am using n-Best list along with an external grammar file and having a conceptual problem. Grammar file is as follows: SEARCHSTRING [ STRING:a <id $a> ] STRING [ (NAMES:b ?NAMES:c) {return(strcat($b $c))} ] NAMES [ [hit] <return("hit")> [sit] <return("sit")> ] Now when I say "hit" the engine also recongnises "sit" with some probability (coz I have allowed it to have at max 5 results). In that case what should be the slot value of b and ultimately of a? Please put in ur comments. |
|
MattHenry
|
|
|
Hi there, I am not sure that this grammar is going to fill slots b and c at all: it appears as if you are trying to fill multiple sub-slots from the same utterance value, and I don't think that this is going to work at all using the method that you are using.....my gut reaction is that this will throw a sizable grammar error when you attempt to run it. Perhaps you can try and give me an idea of what your end goal is in this regard so that I can better understand what you are trying to achieve here? ~Matt |
|
mikejstein
|
|
| I'm trying to put a subgrammar together, that would take both text and numbers. I've got to handle any number, so I can't use a text grammar for it. So if somebody called up and said "BUY 25400", or "SELL 193", it'd work just the same.
I haven't seen anything on mixing grammar types in a subgrammar. Any ideas? |
|
MattHenry
|
|
|
Hi there, Assuming that you aren't trying to mix dtmf and voice input, this should be pretty do-able. A good starting point for yo would be to take a gander at the downloadable subgrammars at the below link: http://evolution.voxeo.com/library/grammar/library.jsp Specifically, eyeball the one titled "numbers2sixteen.grammar", as this contains all the number grammars that you need without having to reinvent the wheel. Assuming that you use the 4 digit string as your low-level rule, you'd simply define your text rule in the file, and then concatenate the results together at the top level rulename, much like we do in this humble tutorial: MY_TOP_RULE [ MY_SUBRULE:z {<mySlotName $z>} ] MY_SUBRULE [ ( MYNUMBER:d1 MYTEXT:d2 ) {return(strcat($d1 $d2))} ] Hope this helps! ~Matt |
|
mzelik
|
|
| I am getting the following error when testing the downloaded code:
00142 bd50 12:49:44 AM =========================== An error occurred while executing the following dialog. Initial URL1: http://mike.softrite.com/subG.xml Initial URL2: null Initial URL3: null Current URL: http://mike.softrite.com/subG.xml?session.callerid=9546104367&session.calledid=4079929967&session.sessionid=e6c15423f50779f419c06c1d6ad4bd50&session.parentsessionid=95b6b35aa44a6ff53bfa9d652cd607b0 Calling Number (ANI): 9546104367 Called Number (DNIS): 4079929967 Redirecting Number (RDNIS): "" State: Form1 VoiceXML Browser Version: 8.0.27086 Date/Time: 2008/4/4 12:49:45.796 VoiceException: error.badfetch.http.404 Failed fetch with code: 404 (Not Found), URL: http://mike.softrite.com/gsl/MySubGrammar.gsl Dialog stack trace: State (Dialog) URL (Document) -------------- ------------------------------ Form1 http://mike.softrite.com/subG.xml?session.callerid=9546104367&session.calledid=4079929967&session.sessionid=e6c15423f50779f419c06c1d6ad4bd50&session.parentsessionid=95b6b35aa44a6ff53bfa9d652cd607b0 The error message is from the Voxeo application debugger. I am using the downloaded code from Voxeo, except for the location of the GSL file. I changed the location to see if that was the problem, but got the same error. I know the GSL file is on the server. I am just learning VoiceXML and vxml for that matter. I looked at the code and cannot see any errors. I used a different WEB server and received the same error. I am stumped. Please advise. Thanks. |
|
voxeojeremyr
|
|
| Hi,
From the error, you are receiving a HTTP error code of 404, which means that the page that it is looking for cannot be found. error.badfetch.http.404 Failed fetch with code: 404 (Not Found), URL: http://mike.softrite.com/gsl/MySubGrammar.gsl I tried to get to that URL but I was unable to. It may be behind a firewall which is why you are getting that error. Thanks, Jeremy Richmond Voxeo Support |
|
mzelik
|
|
| I have made some headway on the problem.
After trying many things, I fould that when I rename the file with an XML extension and change the code accordingly, it works! I am not sure what is causing the problem, but this at least will allow me to continue on the training material. Thanks for your assistance. |
| login |
|