Author Message
VasilyL
Joined: Jul 11, 2016
Messages: 230
Offline
Hi All!

Can someone explain how to work with Grammar with type date?
Mode: Voice.
Style: Static.
Type: date.

In my application I need user to provide (voice) a date (time is not required).

In the OD simulation environment I am trying to send ASR with date but I cannot understand what format it should be?

As an experiment I did the same with DTMF input and it works fine.

But how it works with voice?

Thanks,
Vasily.
VasilyL
Joined: Jul 11, 2016
Messages: 230
Offline
Just to avoid misunderstanding: as an example I used "Visiting Schedule" example from OD samples.
And also tried to use "Visiting Schedule" in OD simulator. But still has no idea what to type in Recognition field when perform "Send ASR" operation.

One more time thanks in advance if someone will decide to bring some light on that question...
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Dates are tricky. If you use the "builtin" date type, please see here https://www.w3.org/TR/voicexml20/#dmlABuiltins. Note:

"The set of accepted spoken input for each builtin type is platform dependent and will vary by language.

The value returned by a builtin type can be read out using the <say-as> element. VoiceXML extends <say-as> in [SSML] by adding 'interpret-as' values corresponding to each builtin type. These values take the form "vxml:<type>" where type is a builtin type. The precise rendering of builtin types is platform-specific and will vary by language.

date Valid spoken inputs include phrases that specify a date, including a month day and year. DTMF inputs are: four digits for the year, followed by two digits for the month, and two digits for the day. The result is a fixed-length date string with format yyyymmdd, e.g. "20000704". If the year is not specified, yyyy is returned as "????"; if the month is not specified mm is returned as "??"; and if the day is not specified dd is returned as "??". If the value is subsequently used in <say-as> with the interpret-as value "vxml:date", it will be spoken as date phrase appropriate to the current language."

I have attached the grammar used for english in simulation. This may not match the platform exactly.
Filename date.xml [Disk] Download
VasilyL
Joined: Jul 11, 2016
Messages: 230
Offline
Hi Ross!

Thanks for an answer!

Thanks for the grammar! It does work.
I cannot say that it is a trivial task to guess with out seeing actual grammar.

Could you please provide grammar for russian in simulation (I tried to provide asr input similary to english grammar but failed)? Does it exist at all?

Thanks!
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Russian is not supported in simulation.
VasilyL
Joined: Jul 11, 2016
Messages: 230
Offline
OK, I see, Thanks.
English is enough in simulation.

Could you please also clarify another question regarding date?
After the date is recognized and stored in project variables how it is possible to say date back to a client to confirm correctness of recognition?
It is possible to to use recognized value YYYYddmm but it will be just digits in pronunciation.
If I convert the value to Java object then it will be equal to toString() invocation with result like "Wed Jan 05 00:00:00 MSK 2011". In simulation sounds fun but I need something like " Janurary 05 2011" pronounced like date but not text.
Does OD supports such feature?

Thanks in advance!
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
One reason for only English in simulation is that builtin grammars can vary between ASR vendors. So when using builtin grammars it is best to test with the actual platform sooner rather than later.

On the month issue you might try the SSML say-as. I am not sure the markup works in simulatoin though. Otherwise you are just going to have to do something like if ( month = 1) then month="January"......
VasilyL
Joined: Jul 11, 2016
Messages: 230
Offline
Hi Ross!
Now it is clear.
Thank you very much for support!
SimonBrown
Joined: Feb 21, 2014
Messages: 58
Offline
Old post but same challenge...
I need to accept Date of Birth with ASR. I will have a Nuance server at some point but not provisioned yet.
I am writing script and trying to accept a DoB entry. I have tried the built-in date grammar but it never gets it right in the simulator. Is this a simulator issue?

I saw attachment so downloaded.
I tried to copy/paste logic into static type, I also tried editing the java for built-in derived file, neither compile and I get warnings.
I was able to add as external grammar by dropping the date.xml into root of my test box website, the "Test" button in the external editor shows the content. However, when I try to say a date I get no response, as though it has no ASR grammar for the input.

Can I ask how this is supposed to be used?

as a note, I am using en-gb for script

/edit: I do get a response now with simulator (forgot to change language from en-us to en-gb in date.xml)
However, the value is not formatted as would expect if using built-in date (yyyymmdd)
What I get in log is, last 3 lines are trace output for the var;
Storing :DOBCapture___utterance to complex: DOBCapture:utterance as [sixteen September nineteen ninety six]
Storing :DOBCapture___value to complex: DOBCapture:value as [16]
Date Value | DOBCapture:value : 16
Date Utterance | DOBCapture:utterance : sixteen September nineteen ninety six
Date interpretation | DOBCapture:interpretation : 16

Looking at OD help (dark art....) it mentions a cxtag but not worked out how to incorporate that into the date.xml (if that is required)

/edit2:
Found and realised the date.xml you linked is same as the one found in OD plugins and it does not appear to handle naturally spoken (at least in English) day i.e. "First", "eighth", "fourteenth"
Not sure how OD wrapping up builtin version to yield correct Value property over an external file yet, tried cxtag basics but that returns just the cxtag itself.


RossYakulis wrote:Dates are tricky. If you use the "builtin" date type, please see here https://www.w3.org/TR/voicexml20/#dmlABuiltins. Note:

"The set of accepted spoken input for each builtin type is platform dependent and will vary by language.

The value returned by a builtin type can be read out using the <say-as> element. VoiceXML extends <say-as> in [SSML] by adding 'interpret-as' values corresponding to each builtin type. These values take the form "vxml:<type>" where type is a builtin type. The precise rendering of builtin types is platform-specific and will vary by language.

date Valid spoken inputs include phrases that specify a date, including a month day and year. DTMF inputs are: four digits for the year, followed by two digits for the month, and two digits for the day. The result is a fixed-length date string with format yyyymmdd, e.g. "20000704". If the year is not specified, yyyy is returned as "????"; if the month is not specified mm is returned as "??"; and if the day is not specified dd is returned as "??". If the value is subsequently used in <say-as> with the interpret-as value "vxml:date", it will be spoken as date phrase appropriate to the current language."

I have attached the grammar used for english in simulation. This may not match the platform exactly.

Unless otherwise stated. EP 7.2.0.0.1117 Dev: JVM: 1.8.0_171 OD 7.2.1.0502 tomcat-8.5.23
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
As you found, the date.xml attached here comes from the simulator plugin. What problem do you see particularly? Also, as Ross said, it is important you try it out on the platform. Nuance should also have something available for dates.
Go to:   
Mobile view