简体   繁体   English

IBM Watson Assistant:如何存储任何类型的输入?

[英]IBM Watson Assistant: How to store any kind of input?

I want to use slots to store a piece of user information inside a variable.我想使用插槽在变量中存储一条用户信息。 This user Information can be anything.这个用户信息可以是任何东西。 Could be a long sentence or just one word or something like bullet points or a numbered list.可以是一个长句子,也可以是一个单词,或者类似项目符号或编号列表之类的东西。 Really whatever.真的随便。

However, using slots I always need Watson to check for something and if that's present it will be stored in a variable.但是,使用插槽时,我总是需要 Watson 来检查某些东西,如果存在,它将存储在一个变量中。

So I guess I have to create a pattern based entity?所以我想我必须创建一个基于模式的实体? How would this pattern look like?这种模式会是什么样子?

I would recommend this doc page from Watson Assistant about expressions for accessing objects .我会推荐这个来自 Watson Assistant 的文档页面,内容是关于访问对象的表达式 One of the global variables is input .全局变量之一是input input.text gives you whatever was provided by the user. input.text为您提供用户提供的任何内容。 You can store that in a context variable or process it and only keep parts of it.您可以将其存储在上下文变量中或对其进行处理并仅保留其中的一部分。

Pattern-based entities only help if you are looking for something specific in the input.只有当您在输入中寻找特定的东西时, 基于模式的实体才有帮助。 It could be used to find, eg, an email address or an URI because they adhere to some patterns.它可用于查找例如 email 地址或 URI,因为它们遵循某些模式。 As said, for capturing the entire input, just access the global input object and access its text part.如前所述,要捕获整个输入,只需访问全局输入 object 并访问其文本部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM