简体   繁体   English

如何在Watson Assistant的技能之间切换?

[英]How to switch between skills on Watson Assistant?

Currently in IBM Watson Assistant you can only assign one skill to an assistant. 当前,在IBM Watson Assistant中,您只能将一种技能分配给助手。 How can I programatically swap the main skill of an assistant? 如何以编程方式交换助理的主要技能?

The plan in the future is to have Assistant support multiple skills as well as custom skills. 未来的计划是让Assistant支持多种技能以及自定义技能。 For the moment as data_henrik mentioned, you can use the V1 API to call each skill. 就在data_henrik提到的那一刻,您可以使用V1 API来调用每个技能。

But having multiple skills still has its challenges, and this might give you some insights. 但是拥有多种技能仍然面临挑战,这可能会给您一些见识。

These are some approaches you can take (names are made up in some cases :). 这些是您可以采用的一些方法(名称在某些情况下是组成的:)。

Spray and pray 喷雾祈祷

In this method you send your user utterance to all workspaces and take the highest scoring one. 通过这种方法,您可以将用户的话语发送到所有工作空间,并获得最高的得分。

This one is needed if you have a large number of intents (>1,000) and you have distinct differences between those intents. 如果您有大量的意图(> 1,000),并且这些意图之间有明显的差异,则需要使用此选项。 It's also the most costly in calls. 这也是通话中最昂贵的。

Gateway 网关

In this set up you have a top level skill. 在此设置中,您具有高级技能。 This attempts to understand the intent of where each question should be routed to. 这试图了解将每个问题路由到何处的意图。 You then call the second skill it suggests as the intent it returns. 然后,您将其暗示的第二项技能称为返回的意图。

This works if you have a large number of intents but similar topics, but not similar enough to group to a single skill. 如果您有大量的意图但主题相似,但又不够相似,无法分组为一项技能,则此方法有效。

Router 路由器

Similar to the gateway, except once you have determined the final skill to route to you then only ever go to that skill. 与网关类似,不同之处在于,一旦您确定了路由到您的最终技能,便只能使用该技能。 If that skill does not understand a later question, then it routes it back to the top level skill to figure out where it should go. 如果该技能无法理解后面的问题,则将其路由回顶级技能,以找出应该去的地方。

This one works well if you have customers with a clearly defined path of where they want to go. 如果您的客户有明确定义的去向,那么此方法就很好用。 As they will tend to ask all their questions in the same area. 因为他们倾向于在同一地区提出所有问题。

Graph 图形

Similar to the router, except when a sub-skill doesn't understand what the person asked, rather then going back to the top level it tries to figure out what other sub-skill has a common relationship with itself (if it can't it hands back to top). 与路由器类似,不同之处在于当子技能无法理解用户的要求时,它会返回至顶层,尝试找出其他子技能与自身有共同的关系(如果无法理解)它回到顶部)。

This helps where multiple skills may have similar intents, but in the context of other questions already asked you would pick one skill over another. 这有助于多种技能可能具有相似的意图,但是在已经提出其他问题的情况下,您会选择一种技能而不是另一种。

Chain

In the chain setup you attempt to answer the user question in the first skill. 在链设置中,您尝试以第一技巧回答用户问题。 If you can't, then you go to your second skill, then so on. 如果不能,那么您将学习第二种技能,依此类推。

Your intents in this case are mapped in order of known frequency. 在这种情况下,您的意图将按已知频率进行映射。

This method works well if you have intents are very similar, but you know the most common questions people ask. 如果您的意图非常相似,但是您知道人们提出的最常见问题,则此方法效果很好。 It's one of the harder ones to implement and maintain though. 不过,它是实施和维护中较难的一种。


Other points. 其他要点。

  • First, every skill needs a context object. 首先,每个技能都需要一个上下文对象。 You can't share the system part of the context object across skills. 您无法跨技能共享上下文对象的系统部分。 If you are using Premium or Watson Assistant Plus, then this is looked after within the skill itself (so you only need to store conversation IDs). 如果您使用的是Premium或Watson Assistant Plus,则将在技能本身内进行照顾(因此您只需要存储对话ID)。

  • "Gateway", "Spray and pray" and "chain" lose the ability to have complex conversational flows without serious work. “网关”,“祈祷与祈祷”和“连锁”失去了进行复杂对话而无需认真工作的能力。

  • If you plan a one-time call from one skill to another, you can use cloud functions to achieve this. 如果您计划一次从一项技能到另一项技能的通话,则可以使用云功能来实现此目的。 It reduces the complexity, and takes the logic outside of the application layer. 它降低了复杂性,并将逻辑带到了应用程序层之外。 I achieve something like this with my language translation example . 通过我的语言翻译示例,我实现了类似的目的。

  • By using the skills instead of the assistant, you lose the ability to do version control based deployments. 通过使用技能而不是助手,您将失去进行基于版本控制的部署的能力。 You can create multiple assistants to get around this, but this makes things more messy. 您可以创建多个助手来解决此问题,但这会使事情变得更加混乱。

In the UI, under Assistants , you can click on the assigned Skill and its dotted menu, then select Swap Skill . 在用户界面中的助手下,您可以单击分配的技能及其虚线菜单,然后选择交换技能 Thus, even with a Lite plan you could test different skills with an Assistant. 因此,即使使用精简版计划,您也可以使用助手测试不同的技能。

If you have a Premium or Plus account, you can have a dialog skill and search skill . 如果您拥有Premium或Plus帐户,则可以具有对话技能和搜索技能

Another option to have multiple skills (workspaces), is to implement an application using the V1 API . 具有多种技能(工作区)的另一种选择是使用V1 API实施应用程序。 It is a stateless REST API and you send a message to a bot identified by its workspace / skill ID. 它是无状态的REST API,您可以向机器人发送一条消息,该机器人由其工作空间/技能ID标识。 Depending on the context and flow, your app would pick the right workspace and send the message accordingly. 根据上下文和流程,您的应用将选择正确的工作区并相应地发送消息。 That way it is possible to create specialized bots (workspaces) or switch from one language to another. 这样就可以创建专门的机器人(工作区)或从一种语言切换到另一种语言。

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

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