[asterisk-speech-rec] Tags don't seem to work

Daniel Floyd daniel.floyd at jps.com
Thu Dec 14 13:39:50 MST 2006


Okay, that fixed it.  Thanks!  I didn't try parentheses on that line when I
tried them on the $yes and $no lines yesterday.  

And this was interesting...  With no parentheses on the $yes or $no lines,
the tag ends up only with the last terminal.  Adding the parentheses groups
the tag with all the terminals.  No big surprise there.  However, on the
$yesorno line, with no parentheses, if $yes matches, then the terminal is
returned, but if $no matches, the tag is returned.  I switched $yes and $no
so that the line read "$yesorno = $no|$yes {$=$$}".  After doing that, the
opposite happened.  If $no matched, the terminal was returned and if $yes
matched, the tag was returned.  I even added completely unrelated and
distinct words to the $yes and $no rules to make sure the engine wasn't
recognizing my "yep" as "yes" or "nope" as "no".  So, I'm not sure what that
is about, but adding the parentheses cleared everything up and gave the
desired behavior so that tags are returned for both rules.

Thanks for the help and quick responses!

Daniel

-----Original Message-----
From: asterisk-speech-rec-bounces at lists.digium.com
[mailto:asterisk-speech-rec-bounces at lists.digium.com] On Behalf Of Randal
Rand
Sent: Thursday, December 14, 2006 2:30 PM
To: Use of speech recognition in Asterisk
Subject: RE: [asterisk-speech-rec] Tags don't seem to work

Daniel,

Are you having similar problems with any of the other grammars?  Did you
include the parentheses around this line like this:

$yesorno = ($yes|$no){$=$$}

What this will do is enforce the return values from the supporting rules is
the return value from root rule $yesorno.


Randal Rand
Speech Application Developer
LumenVox
P: 877-977-0707, just say "Randal"
F: 858-707-7072
RandalRand at LumenVox.com
www.LumenVox.com
 
Tell us what is important to you!  Take our product development survey:
http://www.LumenVox.com/survey/srDevelopment/index.asp

-----Original Message-----
From: asterisk-speech-rec-bounces at lists.digium.com
[mailto:asterisk-speech-rec-bounces at lists.digium.com] On Behalf Of Daniel
Floyd
Sent: Thursday, December 14, 2006 11:21 AM
To: 'Use of speech recognition in Asterisk'
Subject: RE: [asterisk-speech-rec] Tags don't seem to work

Chung,

Thanks for the reply.  I did actually try adding the parentheses before and
it still didn't work.  To make sure that the tags truly weren't working, I
intentionally said "correct" as a response and "correct", not "yes" was
returned by SPEECH_TEXT() both with and without the parentheses.  That's why
I made the statement that perhaps res_speech_lumenvox.so is only returning
the terminals when it builds the string returned by SPEECH_TEXT() and not
the tags with tags exist for a particular rule.

Thanks,
Daniel

-----Original Message-----
From: asterisk-speech-rec-bounces at lists.digium.com
[mailto:asterisk-speech-rec-bounces at lists.digium.com] On Behalf Of Chung Pak
Lai
Sent: Thursday, December 14, 2006 2:04 PM
To: Use of speech recognition in Asterisk
Subject: RE: [asterisk-speech-rec] Tags don't seem to work

Hi David,

The grammar should look like this in order to return the tag "yes"/"no":

---------
#ABNF 1.0;
mode voice;
language en-US;
tag-format <lumenvox/1.0>;

root $yesorno;
$yes = (yes $GARBAGE|yep|yeah|sure|correct):"yes";
$no = (no $GARBAGE|nope):"no";
$yesorno = ($yes|$no) {$=$$};
---------

Notice that the parentheses that added around all terminals and that's for
grouping purpose. If you don't have the parentheses then the tag will only
apply to the last terminal in the rule.

Thanks
--Chung

-----Original Message-----
From: asterisk-speech-rec-bounces at lists.digium.com
[mailto:asterisk-speech-rec-bounces at lists.digium.com] On Behalf Of Daniel
Floyd
Sent: Thursday, December 14, 2006 10:50 AM
To: asterisk-speech-rec at lists.digium.com
Subject: [asterisk-speech-rec] Tags don't seem to work

I'm doing some experiments with the LV speech engine and Asterisk 1.2 and am
having problems with tags.  Specifically, I'm using the yesno.gram from the
pizza demo and if I read the grammar right, regardless of whether "yes",
"yes please", "yep", "yeah", "sure", or "correct" is said, "yes" should be
returned by the SPEECH_TEXT() function (or at the very least "correct"
should return "yes" -- it wasn't clear to me from the docs and other
examples if the tag held for the entire rule or just "correct" and since I
can't get tags to work at all, I couldn't test it to find out).  At any
rate, I always get back what was said, not the tag.  So if I say "correct",
SPEECH_TEXT(0) returns "correct", not "yes".  I thought the point was that
"yes" would be returned.  This happens in both my dialplan and with the
pizza demo.

I've looked through apps/app_speech_utils.c and res/res_speech.c, but
neither are very telling since they are both generic.  So I'm guessing the
interesting stuff is in res_speech_lumenvox.so which of course source is not
available for.  After looking at the Lumenvox API docs, I'm going to venture
a guess (assuming it isn't me) that maybe res_speech_lumenvox.so is only
returning the "terminal" nodes from the parse tree and not the "tag" nodes.
If that's the case, is there a way or plans to change this?  Seems like a
lot of the functionality is lost without tags.  

Here is yesno.gram I am using.  And once again, this is straight out of the
pizza demo.  I'm also using the lumenvox.conf file from the pizza demo
except with an additional grammar file I added for my own dialplan I'm
working on.

---------
#ABNF 1.0;
mode voice;
language en-US;
tag-format <lumenvox/1.0>;

root $yesorno;
$yes = yes $GARBAGE|yep|yeah|sure|correct:"yes";
$no = no $GARBAGE|nope:"no";
$yesorno = $yes|$no {$=$$};
---------

Thanks,
Daniel
 

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-speech-rec

_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-speech-rec
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-speech-rec mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-speech-rec



More information about the asterisk-speech-rec mailing list