| VoiceXML 2.1 Development Guide | Home | Frameset Home |
| special | Data Type: (NULL|VOID|GARBAGE) | Default: Optional |
The special attribute denotes rulenames which are disallowed for redefinition within a grammar. Allowable values are:
Note that either special or uri may be defined for the Ruleref element, but not both. Also be aware that while these special ruleref classes are not accessible when using the Prophecy ASR, they can be used when using Prophecy with the Nuance ASR. | ||
| <?xml version="1.0" encoding="UTF-8" ?>
<vxml version = "2.1"> <meta name="author" content="Matthew Henry"/> <meta name="copyright" content="2005 voxeo corporation"/> <meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/> <form id="F1"> <field name="F_1"> <prompt> William Burroughs. Is he just an understated genius, or simply a half baked junkie writer? </prompt> <grammar src="MyGram.xml" type="application/grammar-xml"/> <filled> <prompt> Say, that guess is as good as any, I suppose. </prompt> </filled> </field> </form> </vxml> |
| <?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root="MYRULE"> <rule id="MYRULE"> <one-of> <item> <!-- note that a fully qualified URL is required --> <ruleref uri= "http://MyServer.com/MyDirectory/MyAlias.xml#MYRULE3"/> </item> <item> alien <tag> <![CDATA[ <F_1 "alien"> ]]> </tag> </item> </one-of> </rule> </grammar> |
| <?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root="MYRULE3"> <!-- note that we MUST declare the rule scope as 'public' --> <rule id="MYRULE3" scope="public"> <one-of> <item> genius <tag> <![CDATA[ <F_1 "genius"> ]]> </tag> </item> <item> smart <tag> <![CDATA[ <F_1 "smart"> ]]> </tag> </item> <item> dumb <tag> <![CDATA[ <F_1 "dumb"> ]]> </tag> </item> </one-of> </rule> </grammar> |
| ANNOTATIONS: EXISTING POSTS |
mtatum111
|
|
| <rule name = "Fairy_tale_character">
<item> <ruleref special = "GARBAGE"/>Red Ridinghood</item> </rule> Can you explain the above to me. I don't quite understand what "GARBAGE" does. Thanks in Advance. |
|
MattHenry
|
|
|
Hello Melissa, I think I can help explain this so that you have a better understanding as to how this works. The first thing that I should make clear is that these "special" rulerefs can only be used when using the Prophecy platform with the Nuance ASR: The Prophecy ASR has no native support for these settings in any capacity. The second thing I wanted to do was to show you a real-world example of this in action to give you some context: <?xml version= "1.0"?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root="INTRO"> <!-- ********** --> <rule id="INTRO"> <one-of> <item> <one-of> <item> repeat </item> </one-of> <tag> <![CDATA[ <MySlot "repeat"> ]]> </tag> <item repeat="0-1"> please </item> <item repeat="0-1"> <ruleref special="GARBAGE"/> </item> </item> </one-of> </rule> </grammar> What ruleref=GARBAGE does is to allow a caller to mumble any utterance, usually as a prefix or suffix to the "real" utterance that we want to capture and not have these additional utterances impact a valid match: I'm hard pressed to think of a scenario where GARBAGE would come in handy by itself without waxing really creative. To further this explanation, take a look at the above grammar, especially the careful nesting of the one-of and item elements. You'll note that the second set of item elements specify a repeat value of 0-1, which makes them optional suffix utterances. As this is the case, then any of the following user utterances would be considered a valid match: - "repeat" - "repeat please" - "repeat with a half a loaf of rye bread and a side of squid ink" Hope this helps to better explain, ~Matthew Henry |
|
mtatum111
|
|
| Matthew, thanks for the explanation. To go a step further,
can you explain special="VOID" and special="NULL" Not quite sure that I understand these. Thanks for any clarification. |
|
VoxeoDustin
|
|
| Hey Melissa,
Per the W3C spec: NULL Defines a rule that is automatically matched: that is, matched without the user speaking any word. XML Form: <ruleref special="NULL"/> VOID Defines a rule that can never be spoken. Inserting VOID into a sequence automatically makes that sequence unspeakable. XML Form: <ruleref special="VOID"/> http://www.w3.org/TR/speech-grammar/#S2.2.3 Let me know if you have any further questions. Thanks, Dustin |
|
mtatum111
|
|
| Can you explain why you would use <ruleref> as a child of item vs. a child of <rule>
I am just trying to understand the differences depending on what the parent is (in this case item or rule). Thanks for any clarification. |
|
voxeoJeffK
|
|
| Hi,
<ruleref> is just an expansion. It just points to another <rule>. If your <ruleref> is a child of <item> then you do have use of <item>'s "repeat" and "weight" attributes, but basically it depends on how you have structured your <rule>s. <!--item as parent--> <rule id="request" scope="public"> may I speak with <one-of> <item> <ruleref uri="#peopleInAccounting"/> </item> <item> <ruleref uri="#peopleInEngineering"/> </item> </one-of> </rule> <!-rule as parent--> <rule id="mailing"> <!--return the box...or...send the envelope--> <ruleref uri="#mailActions"/> <ruleref uri="#mailObjects"/> </rule> hope that helps, Jeff K. |
|
bobpandey
|
|
| Hi All,
I actually want to return a value if the the spoken input is not found in the grammar. For ex: If user has spoken "Subway", the audio is recorded and is tagged. This could be a right or a wrong tag. I need to segrigate if the audio is correctly tagged or not. WHAT I'M DOING: I'm preparing a tag grammar for "Subway" which would be the only entry in the grammar. Tried using garbage also. WHAT I WANT: If the audio matches then it should return "Subway" and if it doesn't match then it should return some garbage value.(Say..TestValueXYZ) MY GRAMMAR LOOKS LIKE: <meta name="swirec_compile_parser" content="1"/> <rule id="subway" scope="public"> <one-of> <item weight="1.0"> <item>subway</item> <tag>value="NAME=subway"</tag> </item> <item weight="10.0"> <ruleref special="GARBAGE"/> <tag>value="NAME=GARBAGE_RULE ReqType=TestValueXYZ"</tag> </item> </one-of> </rule> </grammar> Please help me to understand if I'm doing it correctly or not ? Also, plz do mention if I need to enable/disable any parameter in the configuration file. I just need to return SOME garbage value if the spoken input was not found in the grammar. Any help would be highly appreciated. Thanks, Bob |
|
voxeojeremyr
|
|
| Hello Bob,
I am not sure I understand your question. The special rule 'garbage' is meant to act as a 'filler catcher'. So if you wanted to match the keyword 'Subway' in the utterance "I want to find the Subway" it would be useful there. However they way that you currently have it coded is not is intended use. Is there a reason that you are not using the <no match> tag? If you did that you would simplify the grammar then in the <no match> element you can assign a value to variable if needed. If I misunderstood your question or what you are trying to accomplish, please accept my apologies and if you would give us any additional details that might help. Thanks, Jeremy Richmond Voxeo Support |
|
bobpandey
|
|
| Thanks for the response Jeremy,
Actual Requirement: Actually, I have a prerecoreded set of audios. Each audio contain just one business name, say "Subway". The audio is tagged with the same name. There are many cases when this is incorrectly tagged. I need to find out if the recorded audio is correctly tagged or not. What I'm doing: I am writing a grammar that will have just one entry. If the spoken input matches with this entry, it will be returned with some higher confidence value. And if it doesn't, then it should return some garbage value with a very low confidence. This Confidence value in turn helps me to decide if the tagging is done correctly or not. I was not sure if the garbage rule would work fine for my requirement. I'm just trying to return some value. As you mentioned about the "<no match>" tag, I'm not aware of its functionality. Could you please help me to find out a way so that I can return some value in case of No Match. Also, if you could paste some link wherein I can read about <No Match> tag, it would be really helpful. Thanks, Bob. |
|
voxeoJeffK
|
|
| Hello,
The <nomatch> element will define the actions to take when an input cannot be matched against active grammars. You may find more details here: http://www.vxml.org/nomatch.htm The recognizer will use the configured confidence level to decide on match vs. nomatch, so catching the nomatch event will allow you to alter/flag the audio's tag as appropriate. Regards, Jeff Kustermann Voxeo Support |
| login |