如何将您的聊天机器人从ibm watson助手迁移到rasa

介绍(Introduction)

IBM Watson Assistant has a very minimalist design & development interface, yet very efficient. The four chatbot pillars are well defined with a top layer of advanced functionality…

IBM Watson Assistant具有非常简约的设计和开发界面,但非常高效。 聊天机器人的四个Struts定义明确,并具有高级功能的顶层…

It will hardly ever be a seamless transition when you migrate from one chatbot platform to another. As there are fundamental design and data differences between environments.

从一个聊天机器人平台迁移到另一个平台几乎不可能实现无缝过渡。 由于环境之间存在基础设计和数据差异。

Most chatbot platforms are constituted by the same four basic pillars:

大多数聊天机器人平台由相同的四个基本Struts构成:

  • Intents

    意向
  • Entities

    实体
  • State Machine / Dialog Management

    状态机/对话框管理
  • Script

    脚本
Image for post
Traditional Chatbot Architecture
传统的聊天机器人架构

There are of course variations between systems:

系统之间当然会有差异:

  • The extend to which the core and the NLU elements are separated.

    核心和NLU元素分开的延伸。
  • The propriety structures and data types introduced to entities.

    引入实体的专有结构和数据类型。
  • To which extend entities and intents are merged.

    实体和意图合并到哪个扩展。
  • Special support features.

    特殊的支持功能。

沃森助理结构 (Watson Assistant Structure)

The functionality available In the Watson Assistant console is clearly defined and intuitively structured. It is easy to learn and become familiar with the environment.

Watson Assistant控制台中可用的功能已明确定义且结构直观。 它易于学习并熟悉环境。

Image for post
Basic architectural structure of IBM Watson Assistant
IBM Watson Assistant的基本架构结构

意向(Intents)

IBM Watson Assistant (WA), at its core has a basic intent and entity structure. Intents are as minimalist as can be.

IBM Watson Assistant( WA )的核心是基本意图实体结构。 意图尽可能地简约。

Image for post
Intents Listed
列出的意图

During the intent creation process, there are two features which aid in the defining of intents. Intent Recommendations and Intent Conflict Resolution.

在意图创建过程中,有两个功能可帮助定义意图。 意图建议意图冲突解决

Bot of these features translate into better defined intents, and translates nicely into the JSON export file.

这些功能可以转化为定义更好的意图,并且可以很好地转换为JSON导出文件。

Hence the leverage these functions lend to the intent creation process is not lost.

因此,这些功能有助于意图创建过程的杠杆作用不会丢失。

It must be noted that entities alone can be exported, in CSV format. But all data structures are lost and only the entity utterance examples are exported.

必须注意的是,仅实体可以以CSV格式导出。 但是所有数据结构都丢失了,仅导出了实体话语示例。

实体 (Entities)

Entities within WA does not have any structure attached to them.

WA中的实体没有任何附加结构。

Image for post
Entities Listed
列出的实体

This simplifies the transition process.

这简化了过渡过程。

Synonym Recommendations is a feature which improves the quality of the entities created.

同义词建议是一项功能,可以提高创建的实体的质量。

Fortunately, this translates into the export of the skill.

幸运的是,这转化为技能的输出。

Annotation is key in establishing truly contextual entities.

注释是建立真正的上下文实体的关键。

This is part and parcel of the export and translates well into Rasa.

这是出口的重要组成部分,可以很好地转化为Rasa。

Entities can also be exported in CSV format. But again, data structures are lost.

实体也可以CSV格式导出。 但是同样,数据结构也丢失了。

对话框(对话节点) (Dialog (Conversational Nodes))

This is where it becomes tricky. It must be noted, that IBM Watson does have a NLU API function within their cloud offering.

这是棘手的地方。 必须注意,IBM Watson在其云产品中确实具有NLU API函数。

Image for post
WA web based dialog node and conversational state management.
基于WA Web的对话节点和对话状态管理。

But for WA, the chat environment is combined with the NLU portion.

但是对于WA,聊天环境与NLU部分结合在一起。

This is a completely opposite approach compared to AWS Lex or Microsoft LUIS/Bot Framework.

与AWS Lex或Microsoft LUIS / Bot Framework相比,这是完全相反的方法。

The console is completely integrated with all of this functionality made available via an feature rich API.

控制台与通过功能丰富的API提供的所有这些功能完全集成在一起。

The good news is that in the chatbot JSON export file creates a clear distinction between the intents/entities and the dialog flow.

好消息是,在chatbot JSON导出文件中,意图/实体与对话框流之间形成了明显的区别。

Hence the manipulation of the file is easy as the segmentation of components are clearly defined.

因此,由于明确定义了组件的分段,因此文件的操作非常容易。

沃森特定功能 (Watson Specific Functionality)

At the very top of the Basic architectural structure of IBM Watson Assistant diagram you will see a set of Watson specific features.

IBM Watson Assistant图的基本体系结构的最顶部,您将看到一组Watson特定的功能。

Image for post
Under Options you see Watson Assistant Specific Features
在选项下,您可以看到Watson Assistant的特定功能

These are Webhooks, Disambiguation, Auto Learning, Auto Correction, Irrelevance Detection, System Entities & Fuzzy Matching.

这些是Webhooks,消歧,自动学习,自动校正,不相关检测,系统实体和模糊匹配。

These features really do augment the chatbot performance and drives down the user effort.

这些功能确实可以增强聊天机器人的性能,并降低用户的工作量。

Unfortunately, on migration, these functions will be lost. But, it needs to be mentioned that these functions do not pollute or clutter the skill export. The export file is clean and readable. It is almost as if IBM separates skills into two segments.

不幸的是,在迁移时,这些功能将丢失。 但是,需要指出的是,这些功能不会污染或干扰技能输出。 导出文件是干净且可读的。 就像IBM将技能分为两个部分一样。

The one is the user crafting the chatbot elements, and the Watson augmenting these elements.

一个是用户制作聊天机器人元素,而Watson则增加了这些元素。

Watson Assistant导出与Rasa nlu.md格式相比 (Watson Assistant Export Compared To Rasa nlu.md Format)

方法(Approach)

The general approach I will following migrating to Rasa from Watson Assistant would be to export the WA skill into a JSON formatted file.

从Watson Assistant迁移到Rasa后,我将采用的一般方法是将WA技能导出为JSON格式的文件。

From there you can create a conversion program to convert the JSON export into the Rasa nlu.md file format.

在这里,您可以创建一个转换程序,以将JSON导出转换为Rasa nlu.md文件格式。

The lack of entity structures within WA bodes well for the migration process.

西澳大利亚州内部缺乏实体结构对迁移过程而言是一个好兆头。

意向 (Intents)

The format of intent exports in the JSON file from Watson Assistant:

从Watson Assistant在JSON文件中导出意图的格式:

{
"intents": [
{
"intent": "InformationLoan",
"examples": [
{
"text": "How can I get information on loans?"
},
{
"text": "How can I get more information on loans?"
},
{
"text": "how does applying for a loan work"
},
{
"text": "How does loans work"
},
{
"text": "Information on loans please"
},
{
"text": "where do I go for info on loans"
}
],
"description": ""
},

Compared to Rasa’s NLU Format:

与Rasa的NLU格式相比:

## intent:ask_transfer_charge
- Will I be charged for transferring money
- do transfers cost something?
- is there a transfer charge?
- Is there a charge
- will i be charged for a transaction?
- do xfers cost something?
- is there a transfer fee
- is there a xfer fee
- how much is the transfer fee

Form this comparison creating intent training data from the WA export via text manipulation is straight forward.

通过这种比较,通过文本操作从WA导出创建意图训练数据的方法很简单。

实体 (Entities)

I prefer chatbot development environments where the entities can be annotated within the intent. in many environments the intents and entities are too far removed; but here there is a convergence.

我更喜欢在聊天机器人开发环境中可以在意图内对实体进行注释的环境。 在许多环境中,意图和实体相距太远; 但是这里有一个融合。

Below is an WA export example, with the intent name, with a text example. You will also see the entity name and the location of the entity.

下面是一个WA导出示例,其中包含意图名称和一个文本示例。 您还将看到实体名称和实体位置。

{
"intent": "TransferMoney",
"examples": [
{
"text": "Can we transfer money from my savings account to my bond account",
"mentions": [
{
"entity": "Money",
"location": [
16,
21
]
},
{
"entity": "ToAccount",
"location": [
52,
56
]
},
{
"entity": "FromAccount",
"location": [
30,
37
]
}
]
},

Elsewhere the entity is defined in detail:

在其他地方详细定义了实体:

{
"entity": "Money",
"values": [
{
"type": "synonyms",
"value": "money",
"synonyms": []
},
{
"type": "synonyms",
"value": "R500",
"synonyms": [
"10000",
"400",
"R500"
]
}
],
"fuzzy_match": true
},

Comparing this to the nlu.md file format:

将此与nlu.md文件格式进行比较:

- I want to pay the [current balance](payment_amount) on my [credit card](account_type)

From the WA example the nlu.md format can be generated. The only impediment, within WA entities can be defined in isolation. Adding these to Rasa might proof problematic.

WA示例中,可以生成nlu.md格式。 WA实体内的唯一障碍可以单独定义。 将这些添加到Rasa可能证明是有问题的。

对话/故事 (Dialog / Stories)

Rasa’s approach to dialog management cannot be fore juxtaposed to IBM’s approach. WA has a very rigid dialog management environment. Elements like disambiguation, digression, multiple conditioned responses and a huge amount of business logic are vested in the dialog, and makes for a complex environment.

Rasa的对话框管理方法不能与IBM的方法并列。 WA具有非常严格的对话框管理环境。 歧义,离题,多重条件响应和大量业务逻辑之类的元素都归属于对话框中,并构成了复杂的环境。

Slots are also defined in the dialog. Most probably the best approach will be to create user stories from the different permutations which exist within the defined WA dialog. This will be a manual process; with the added advantage of being able to visually inspect the dialog within WA.

对话框中也定义了插槽。 最好的方法可能是根据定义的WA对话框中存在的不同排列来创建用户案例。 这将是一个手动过程; 附加的优点是能够在WA中可视地检查对话框。

结论 (Conclusion)

To constitute the Rasa NLU portion will be very much straight forward; the NLU API if you like. Most, if not all, of this portion can be automated with a text manipulation program. The Rasa Core portion will take manual intervention.

构成Rasa NLU部分非常简单。 如果愿意,可以使用NLU API。 这部分的大部分(如果不是全部的话)可以使用文本处理程序自动执行。 Rasa Core部分将进行手动干预。

However, by stepping through the application to extracting the user stories can also be used as an opportunity to optimize and improve the chatbot dialog.

但是,通过逐步执行应用程序来提取用户故事,也可以用作优化和改善聊天机器人对话框的机会。

在这里阅读更多… (Read More Here…)

翻译自: https://medium.com/@CobusGreyling/how-to-migrate-your-chatbot-from-ibm-watson-assistant-to-rasa-e43f2a008db3

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值