vxml:使用等效输入定义语法

发布于 2024-09-08 16:41:06 字数 1007 浏览 2 评论 0原文

我正在使用基于 TellMe 的引擎。我见过一些语法示例,其中用户可以说一些被认为相同的不同事物之一。然而,我见过的所有示例都是内联语法(不适用于我使用的 vxml 引擎)。我想知道如何更改 .grxml 文件来执行此操作。这是文件:

<?xml version="1.0"?>
<!-- created by Matthew Murdock. Grammars for speech rec menus -->
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar      http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0.2006">
   <rule id="keep">
      <one-of>
         <item>exit</item>
         <item>exit the system</item>
         <item>another</item>
         <item>another mailbox</item>
         <item>play</item>
         <item>play back</item>                      
      </one-of>
   </rule>
</grammar>

我想要 3 个项目,而不是 6 个项目,每个项目有两个可能的话语。关于我如何做到这一点有什么想法吗?

I am using an engine based on TellMe. I have seen examples of grammars where the user can say one of a few different things that are considered the same. However, all the examples i've seen have been for in-line grammars (which dont work with the vxml engine im using). I want to know how i can change my .grxml file to do this. This is the file:

<?xml version="1.0"?>
<!-- created by Matthew Murdock. Grammars for speech rec menus -->
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar      http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0.2006">
   <rule id="keep">
      <one-of>
         <item>exit</item>
         <item>exit the system</item>
         <item>another</item>
         <item>another mailbox</item>
         <item>play</item>
         <item>play back</item>                      
      </one-of>
   </rule>
</grammar>

instead of having 6 items, i want to have 3 items, each having two possible utterances. Any ideas on how i can do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不一样的天空 2024-09-15 16:41:06

更紧凑的形式:

  <rule id="exit">
    exit <item repeat="0-1">the system</item>
    <tag>out.result = "exit"</tag>
  </rule>
  <rule id="play">
    play <item repeat="0-1">back</item>
    <tag>out.result = "play"</tag>
  </rule>

A more compact form:

  <rule id="exit">
    exit <item repeat="0-1">the system</item>
    <tag>out.result = "exit"</tag>
  </rule>
  <rule id="play">
    play <item repeat="0-1">back</item>
    <tag>out.result = "play"</tag>
  </rule>
下雨或天晴 2024-09-15 16:41:06

您想要的答案位于 SISR 规范中,该规范提供了一种将含义附加到的机制输入路径。重写您的示例:

<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar      http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
   <rule id="keep">
      <one-of>
       <item>
        <one-of>
         <item>exit</item>
         <item>exit the system</item>
        </one-of>
        <tag>exit</tag>
        </item>

       <item>
        <one-of>
         <item>another</item>
         <item>another mailbox</item>
        </one-of>
        <tag>another</tag>
       </item>

       <item>
        <one-of>
         <item>play</item>
         <item>play back</item>                      
        </one-of>
        <tag>play</tag>
       </item>
      </one-of>
   </rule>
</grammar>

需要了解的几件事:

  • 我选择了文字标记格式(注意语法元素的标记格式属性)。它也可以使用“semantics/1.0”来实现,并且标签的内容将如下所示:out =“exit”;
  • TellMe 标记格式值可能需要不同,但其开发指南 意味着他们遵循标准。
  • 一旦你让它工作起来,请毫不犹豫地创建填充语法(用 SRGS 来说,规则)。填充规则是没有任何 SI(无标签元素)的规则,并且包含人们添加到响应中的常用短语。例如,可以在语法末尾添加尾随规则:
 
      <项目重复=“0-1”>
   

   <规则id=“尾随”>
      <其中之一>
         <项目>请
         <项目>谢谢

      
   


这将支持更自然的响应类型。这可能重要也可能不重要,具体取决于您的通话基础。填充语法可能非常大,但往往具有高度可重用性。您还可以在输入的开头添加填充符。在丰富的语音应用程序中,调整过程中最重要的收获涉及更新语法以包含调用者所说的实际短语与开发人员或 VUI 设计者认为会说的短语。

The answers you want are in the SISR specification which provides a mechanism for attaching meaning to input paths. Rewriting your example:

<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar      http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
   <rule id="keep">
      <one-of>
       <item>
        <one-of>
         <item>exit</item>
         <item>exit the system</item>
        </one-of>
        <tag>exit</tag>
        </item>

       <item>
        <one-of>
         <item>another</item>
         <item>another mailbox</item>
        </one-of>
        <tag>another</tag>
       </item>

       <item>
        <one-of>
         <item>play</item>
         <item>play back</item>                      
        </one-of>
        <tag>play</tag>
       </item>
      </one-of>
   </rule>
</grammar>

Several things to know:

  • I chose the literal tag format (notice the tag-format attribute of the grammar element). It could have also been implemented using "semantics/1.0" and the contents of the tag would have looked like: out="exit";
  • TellMe tag-format values may need to be different, but their development guide implies they follow the standards.
  • Once you have it working, don't hesitate to create filler grammars (in SRGS speak, rules). Filler rules would be rules without any SI (no tag elements) and contain common phrases people add to responses. For example, a trailing rule that could be added at the end of your grammar:
      </one-of>
      <item repeat="0-1"><ruleref uri="#trailing"/></item>
   </rule>

   <rule id="trailing>
      <one-of>
         <item>please</item>
         <item>thank you</item>

      </one-of>
   </rule>

</grammar>

This would support more natural types of responses. This may or may not be important depending on your calling base. Filler grammars can be very large, but tend to be highly reusable. You can also add filler at the beginning of input. In rich speech applications, a the most significant gain in the tuning process involves updating the grammar to contain the actual phrases spoken by the caller versus what the developer or VUI designer thought would be spoken.

旧故 2024-09-15 16:41:06

我想通了。我将语法更改为如下所示:

<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar      http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
   <rule id="keep">
      <one-of>
         <item><ruleref id="#exit"/></item>
         <item><ruleref id="#play"/></item>
      </one-of>
   </rule>
   <rule id="exit">
      <one-of>
         <item>exit</item>
         <item>exit the system</item>
      </one-of>
      <tag>out.result = "exit"</tag>
   </rule>
   <rule id="play">
      <one-of>
         <item>play</item>
         <item>play back</item>
      </one-of>
      <tag>out.result = "play"</tag>
   </rule>
</grammar>

然后,回到脚本中,我不再将操作基于 callerInput( 标记中指定的变量),而是基于 callerInput$。解释,它保存包含我在语法的 元素中分配给 out.result 的任何内容的 xml。

我认为将您的操作基于“解释”而不是调用者的文字输入是有意义的。

注意:因为我们正在使用自己的 vxml 引擎,所以我们能够创建一种从 xml 中提取解释值的方法。

I figured it out. I changed my grammar to look like this:

<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar      http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
   <rule id="keep">
      <one-of>
         <item><ruleref id="#exit"/></item>
         <item><ruleref id="#play"/></item>
      </one-of>
   </rule>
   <rule id="exit">
      <one-of>
         <item>exit</item>
         <item>exit the system</item>
      </one-of>
      <tag>out.result = "exit"</tag>
   </rule>
   <rule id="play">
      <one-of>
         <item>play</item>
         <item>play back</item>
      </one-of>
      <tag>out.result = "play"</tag>
   </rule>
</grammar>

Then, back in my script instead of basing my actions on callerInput (the variable specified in the <field> tag), i based them off of callerInput$.interpretation which holds xml containing whatever i assigned out.result to in the <tag> element of the grammar.

I guess it makes sense to base your actions on the "interpretation" and not the caller's literal input.

NOTE: Because we are working with our own vxml engine we were able to create a method for extracting the interpretation value out of the xml.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文