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

Daniel Floyd daniel.floyd at jps.com
Thu Dec 14 12:21:01 MST 2006


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



More information about the asterisk-speech-rec mailing list