如何在lex中创建开放式插槽

如何在lex中创建开放式插槽

本文介绍了如何在lex中创建开放式插槽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Lex机器人中创建一个注释/反馈字段,但这似乎很难做到。

I'd like to create a notes/feedback field in my Lex bot, but it appears difficult to do.

好像是AMAZON.LITERAL曾经做过为此,当前的建议是创建一个自定义插槽并将大量随机数据注入其中(-要点3和其他Google)。

It seems like AMAZON.LITERAL used to do this, and current suggestions are to create a custom slot and pump a bunch of random data into it (http://docs.aws.amazon.com/lex/latest/dg/gl-guidelines.html - bullet point 3 and other googles).

这是最好的方法吗?有谁知道任何示例或方法来更好地说明如何做到这一点?

Is this the best way to do it? Does anyone know of any examples or methods to better show how this can be done?

推荐答案

对于我来说,将随机数据馈送到插槽是行不通的。它过去仅捕获该插槽的一部分输入,或者在大多数情况下为该插槽分配 NULL

In my case, feeding random data to the slot did not work. It used to capture only a part of input for the slot or most of the time it assigns NULL to the slot.

解决此问题的方法,我只是创建了一个没有任何数据的插槽,并在DialogCodeHook中将 inputTranscript 数据分配到了该插槽中。

To solve this problem, I just made a slot without any data and in the DialogCodeHook I assigned the inputTranscript data into the slot.

slots = intent_request['currentIntent']['slots']
slots['your_slot'] = intent_request['inputTranscript']

如果您找到更好的方法,请发表评论/答案。

Please comment/answer if you find a better way to do this.

这篇关于如何在lex中创建开放式插槽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 04:32