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

查看:17
本文介绍了用于拼写字母的 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 语音(alpha bravo charlie"代表ABC"") 因为这是一种糟糕的用户体验,很少有人真正了解它们.

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}

但我认为亚马逊不会让您使用自定义槽定义可变长度的 LITERAL(因为它们是不同的类型")?

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.

对于 Intent,创建一个包含五个插槽的 Intent,所有插槽都具有相同的插槽类型.创建五个反对意图的话语,填充一、二、三、四和五个槽.当用户拼写某些东西时,将调用意图.用户未指定的任何插槽都将为空.

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.

在一个 Intent 中有两个槽而不用一个词分隔通常效果不佳.但是试试看.像这样的词汇量有限,它可以做到.

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"技能并试验Set Call Sign to X Y Z"意图.我在该技能中执行了上述操作,并且效果很好.

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天全站免登陆