AWS Lex-默认插槽类型没有限制 [英] AWS Lex - Default slot type has no limits

查看:60
本文介绍了AWS Lex-默认插槽类型没有限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在AWS Lex中,我使用默认的AMAZON.Country作为插槽类型.但是,当我与测试机器人进行交互时,我可以输入任何值(例如我不知道"),并且当我检查响应时,JSON表示国家"的值为我不知道"

In AWS Lex, I am using the default AMAZON.Country as a slot type. However, when I interact with the test bot, I can enter any value (for instance "I don't know") and the JSON when I inspect the response says that the value for 'country' is "I don't know".

插槽类型的目的是将答案限制为现有国家/地区名称.没有一些随机的句子.知道为什么我没有得到预期的行为吗?

The purpose of a slot type, is that it limits the answers to existing country names. Not some random sentences. Any idea why I don't get the expected behaviour?

推荐答案

广告位类型的目的是限制答案...."

"The purpose of a slot type, is that it limits the answers...."

这实际上是不正确的,并且是在开始使用Lex开发时的常见误解.

That is not actually true and is a common misconception when starting to develop with Lex.

经验告诉我们,广告位类型的主要目的只是为了改善输入识别并用最期望或期望的内容填充广告位,但它限制可以填充广告位的值

Experience has taught us that the main purpose of slot types is simply to improve input recognition and fill the slot with what is most expected or desired but it does not limit the values that can fill the slot.

这就是为什么我们Lex开发人员还使用Lambda编写解析和验证代码来自己仔细检查插槽值或inputTranscript的原因.

This is why we Lex developers also write parsing and validation code in Lambda to double check the slot values or the inputTranscript ourselves.

Lex似乎应该为您做得更好(我想我们都以为是这样),但是一旦您开始自己的解析/验证,您就会意识到实际上需要进行多少控制您的机器人更聪明,更自然.

It might seem like Lex should do a better job of this for you, (I think we all start out assuming that) but once you start doing your own parsing/validating, you realize how much more control you actually have to make your bot smarter and more natural.

文档

Amazon Lex内置插槽类型请Lex开发人员参考Alexa文档.

Amazon Lex Built-In Slot Types refers Lex developers to Alexa docs.

Amazon Lex支持Alexa Skills Kit中的内置插槽类型.
...请参阅Alexa Skills Kit文档中的插槽类型参考

Amazon Lex supports built-in slot types from the Alexa Skills Kit.
...see Slot Type Reference in the Alexa Skills Kit documentation

广告位类型Alexa技能套件中的参考:

重要:内置插槽类型与枚举等效.如果语音理解系统能够识别出列表之外的值,则仍会返回该值.尽管插槽类型的输入权重于列表中的值,但它不仅限于列表中的项.使用广告位值时,您的代码仍需要包含验证和错误检查.

Important: A built-in slot type is not the equivalent of an enumeration. Values outside the list are still returned if recognized by the spoken language understanding system. Although input to the slot type is weighted towards the values in the list, it is not constrained to just the items on the list. Your code still needs to include validation and error checking when using slot values.

这篇关于AWS Lex-默认插槽类型没有限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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