Amazon Alexa:存储用户的话 [英] Amazon Alexa: store user's words

查看:82
本文介绍了Amazon Alexa:存储用户的话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始写Alexa技能,并且想写一种技巧来存储说话者的话。

例如,如果我说 Alexa,保存{无论我说什么},它应该将单词保存在某个字符串中。

现在,据我了解,意图架构应类似于

I'm new to writing Alexa skills and want to write a skill to store the speaker's words.
For example, if I say, 'Alexa, save {whatever i say}', it should save the words in some string.
Now from what I understand, the intent schema something should be like

{
   intents:[
       "intent" : "SaveIntent"
   ]
}

和类似

SaveIntent save
SaveIntent store

在这种情况下,如何存储'{无论我说什么}'?

In this case, how do I store '{whatever I say}'?

推荐答案

要捕获自由形式的语音输入(而不是定义的可能值列表),您需要使用 AMAZON.LITERAL 插槽类型。 有关Literal插槽类型的Amazon文档描述了一个与您的用例类似的用例,在该用例中,您可以创建技巧来获取任何短语并将其发布到社交媒体网站上。这是通过创建StatusUpdate意向来完成的:

To capture free-form speech input (rather than a defined list of possible values), you'll need to use the AMAZON.LITERAL slot type. The Amazon documentation for the Literal slot type describes a use case similar to yours, where a skill is created to take any phrase and post it to a Social Media site. This is done by creating a StatusUpdate intent:

{
  "intents": [
    {
      "intent": "StatusUpdate",
      "slots": [
        {
          "name": "UpdateText",
          "type": "AMAZON.LITERAL"
        }
      ]
    }
  ]
}

由于它使用 AMAZON.LITERAL 槽位类型,因此该意图将能够捕获任意短语。但是,为了确保语音引擎在捕获现实世界的短语方面做得不错,您需要提供各种示例话语,它们类似于您希望用户说的那种话。

Since it uses the AMAZON.LITERAL slot type, this intent will be able to capture any arbitrary phrase. However, to ensure that the speech engine will do a decent job of capturing real-world phrases, you need to provide a variety of example utterances that resemble the sorts of things you expect the user to say.

鉴于您所描述的情况,您正试图捕获非常个动态短语,因此在文档中有一些需要的东西要特别注意以下方面:

Given that in your described scenario, you're trying to capture very dynamic phrases, there's a couple things in the documentation you'll want to give extra consideration to:


如果您使用AMAZON.LITERAL类型来收集格式多样的自由格式文本
在插槽中可能出现的单词数中,
请注意以下内容:

If you are using the AMAZON.LITERAL type to collect free-form text with wide variations in the number of words that might be in the slot, note the following:


  • 覆盖整个范围(最小,最大,以及介于两者之间的所有内容),
    将需要大量样本。尝试提供数百个
    或更多的样本,以解决上述
    中槽值字的所有变化。

  • 将插槽中的短语保留足够短的时间,以便用户可以
    说出整个短语而无需暂停。

冗长的语音输入可能会导致较低的准确度体验,因此请避免
设计一种语音语言界面,该语言界面要求插槽值使用多个
个单词。对于用户来说,如果没有
暂停,就无法说出一个短语,对于广告位值来说太长了。

Lengthy spoken input can lead to lower accuracy experiences, so avoid designing a spoken language interface that requires more than a few words for a slot value. A phrase that a user cannot speak without pausing is too long for a slot value.

也就是说,这是示例再次从文档中获取示例话语:

That said, here's the example Sample Utterances from the documentation, again:


StatusUpdate发布更新{arrived | UpdateText}

StatusUpdate post the update {arrived|UpdateText}

StatusUpdate发布更新{晚餐时间| UpdateText}

StatusUpdate post the update {dinner time|UpdateText}

StatusUpdate发布更新{晚餐时| UpdateText}

StatusUpdate post the update {out at lunch|UpdateText}

...(更多示例显示包含4-10个单词的短语)

...(more samples showing phrases with 4-10 words)

StatusUpdate发布更新{今天晚上要在杂货店停下来| UpdateText }

StatusUpdate post the update {going to stop by the grocery store this evening|UpdateText}

如果您提供了足够的不同长度示例,以准确显示预期的用户话语范围,则您的意图是能够在实际使用案例中准确捕获动态短语,您可以在 UpdateText 插槽中访问这些短语。基于此,您应该能够实现针对自己需求的意图。

If you provide enough examples of different lengths to give an accurate picture of the range of expected user utterances, then your intent will be able to accurately capture dynamic phrases in real uses cases, which you can access in the UpdateText slot. Based on this, you should be able to implement an intent specific to your needs.

这篇关于Amazon Alexa:存储用户的话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆