Alexa技能用户输入,用于拼写字母 [英] alexa skill user input for spelling out letters

查看:61
本文介绍了Alexa技能用户输入,用于拼写字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望Alexa能够接受我的自定义技能的可变长度的英文字母列表。它将允许用户基于字符串进行搜索。

I'd like Alexa to be able to accept a variable-length list of English letters to my custom skill. It will allow users to search based on a string.

这有两个步骤:


  1. 为单个字母得到良好的表示Alexa可以理解

  2. 枚举可变数量字母的样本话语

第一个是一种方法是定义一个自定义广告位,其英文字母的枚举值为:

For the first, one way would be to define a custom slot that has as its enumerated values of the English alphabet:

SLOT_LETTER

ay
bee
see
dee
ee
eff
gee
... etc

但这感觉很棘手。亚马逊是否支持任何方式做到这一点?或者有更聪明的方式吗?

but that feels hacky. Does Amazon support any way to do this or is there a cleverer way?

我真的宁愿不使用 NATO语音( ABC的 alpha bravo charlie),因为这是一种糟糕的用户体验,很少有人真正了解它们。

I'd really rather not use NATO phonetic ("alpha bravo charlie" for "A-B-C") because it's a terrible user experience and very few people actually know them.

对于第二期(样本话语),对于 AMAZON.LITERAL 我想定义以下内容:

For the second issue (sample utterances), for AMAZON.LITERAL I want to define something like:

SpellIntent find me things starting with {first second|SLOT_LETTER}   
SpellIntent find me things starting with {first second third|SLOT_LETTER}
SpellIntent find me things starting with {first second third fourth|SLOT_LETTER}

难道Amazon不会让您使用自定义插槽定义长度可变的文字(因为它们是不同的类型)?

But I don't think Amazon will let you define a variable length LITERAL using a custom slot (since they are different "types")?

推荐答案

它的文档记录不是很好,但是您可以使用 a。, b。, c。。等代表字母,而不是声音。创建一个自定义插槽,并将其用作值。

It isn't very well documented, but you can use "a.", "b.", "c." etc to represent the letter, as opposed to the sound. Create a custom slot and use these as the values. That should do you for the slot.

对于该意图,请创建一个包含五个插槽的意图,所有这些插槽均具有相同的插槽类型。针对意图创建五种发音,分​​别填充一个,两个,三个,四个和五个插槽。当用户拼写某些东西时,意图将被调用。用户未指定的任何插槽都将为空。

For the intent, create an intent with, say, five slots, all with the same slot type. Create five utterances against the intent, with one, two, three, four and five slots filled. When the user spells something, the intent will be invoked. Any slots the user did not specify will be null.

在一个意图中有两个不被单词分隔的插槽通常效果不佳。但是尝试一下看看。

Having two slots in one intent not separated by a word often does not perform well. But try it and see. With a restricted vocabulary like this, it could do OK.

最后,如果在辨别 b时遇到困难。和 v。,您可以尝试将北约呼叫代码添加到列表中。 Alpha,Bravo,Charlie等。然后,在您的处理过程中,只需输入插槽中所含值的第一个字符即可。

Lastly, if it has trouble distinguishing, say, "b." and "v.", you might try adding NATO call codes to your list. Alpha, Bravo, Charlie, etc. Then, in your processing, just take the first character of whatever value comes in for the slot.

您可以启用 Star Lanes技巧和实验,并使用将呼号设置为XYZ的意图。我在该技能上做到了以上所述,并且效果很好。

You might enable the "Star Lanes" skill and experiment with the "Set Call Sign to X Y Z" intent. I do the above in that skill and it works fairly well.

这篇关于Alexa技能用户输入,用于拼写字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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