为LUIS.AI创建API或使用.JSON文件,以便为非技术用户培训机器人 [英] Creating an API for LUIS.AI or using .JSON files in order to train the bot for non-technical users

查看:115
本文介绍了为LUIS.AI创建API或使用.JSON文件,以便为非技术用户培训机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用.NET,MS Bot Framework和LUIS.ai的智能机器人.

I have a bot that uses .NET, MS Bot Framework and LUIS.ai for its smarts.

很好,除了我需要为非技术用户提供一种方法来训练机器人并教给它新的东西,即LUIS.ai中的新意图.

All's fine, except that I need to provide a way for non-technical users to train the bot and teach it new things, i.e. new intents in LUIS.ai.

换句话说,假设现在该机器人可以用包含说明的简单短语来回答诸如嘿机器人我可以在哪里喝咖啡"和我可以在哪里买衣服"之类的消息.非技术用户也需要能够对其进行培训,以回答我在哪里可以得到食物".

In other words, suppose that right now the bot can answer messages like "hey bot where can i get coffee" and "where can I buy some clothes" with simple phrases containing directions. Non-technical users need to be able to train it to answer "where can I get some food" too.

这就是我所考虑的:

  • 继续使用LUIS.ai.不起作用,因为LUIS.ai没有API.它最好的功能是可以改善现有意图的GUI和上载应用程序/短语列表功能.如果可以通过我编写的某些应用程序生成带有该应用程序的JSON文件,则该过程可以是半自动化的.但是,仍然需要处理新意图的后端代码,并且必须由C#编码器来实现.

  • Continuing to use LUIS.ai. Doesn't work because LUIS.ai doesn't have an API. The best it has is the GUI to refine existing intents, and the upload app/phrase list feature. The process can be semi-automated if the JSON file with the app can be generated by some application that I write; however, there still needs to be backend code that handles the new intents, and that has to be implemented by a C# coder.

如果我从C#切换到Node.js,它可以工作吗?从理论上讲,我将能够自动生成代码文件/意图处理程序.

Could it work if I switch from C# to Node.js? Then theoretically I would be able to auto-generate code files / intent handlers.

  • Azure Bot服务.似乎它没有非技术性的界面,而只是一个基于浏览器的IDE.

  • Azure Bot Service. Seems it doesn't have a non-technical interface and is just a browser-based IDE.

    完全抛弃Bot Framework,并使用诸如motion.ai之类的第三方工具.不起作用,因为没有LUIS.ai提供的智力".

    Ditching Bot Framework entirely and using third-party tools such as motion.ai. Doesn't work because there's no "intellect" as the one provided by LUIS.ai.

    使用Bot Framework一部分的Form Flow.如果我的GUI机器人构建器应用程序可以生成JSON文件,则Bot Framework可以使用这些文件来自动构建机器人.不起作用,因为LUIS.ai中没有智力.

    Using Form Flow that's part of Bot Framework. If my GUI bot builder application can generate JSON files, these files can be used by Bot Framework to build a bot automatically. Doesn't work because there's no intellect as in LUIS.ai.

    继续使用Bot Framework,但放弃LUIS并基于用于确定意图的node.js语言处理库构建一个单独的Web服务.可能工作或可能不工作,可能不如LUIS聪明,并且可能是一个过大的杀伤力.

    Keep using Bot Framework, but ditch LUIS and build a separate web service based on a node.js language processing library for determining intents. May or may not work, may be less smart than LUIS, and could be an overkill.

    重写LuisDialog中从LuisResponse中选择意图的方法,以便使用我自己的方式来确定意图(但是如何?).

    Override the method in LuisDialog that selects the intent from the LuisResponse, in order to use the my own way to decide the intent (but how?).

    在这一点上,我没有想法,任何指针将不胜感激.

    At this point I'm out of ideas and any pointers will be greatly appreciated.

    推荐答案

    首先,LUIS.ai提供了 API 自动进行培训.此外,此处是Luis Trainer完全用Python编写而成,而API正是这样做的.

    First of all, LUIS.ai provides an API that you can use to automatize the training. Moreover, here is Luis Trainer written entirely in Python against the API that just does that.

    最简单的一种可能是您在#1中描述的一种:您可以使培训自动化(如上所述),但是如果提供了新的意图,您仍然必须部署新版本的bot.一件事是让用户以新的语言来训练现有模型,另一件事是让他们创建模型:)

    The easiest one, probably is the one you are describing in #1: you can automatize the training (as explaining above) but you will still have to deploy a new version of the bot if new intents are being provided. One thing is letting users to train an existing model with new utteraces and another completely and different thing is to let them create the model :)

    可能很难跳过不得不编写后端代码的情况(我根本不会将其自动化)

    It might be hard to skip having to write the backend code (I wouldn't automatize that at all)

    这是一个潜在的主意(虽然不确定是否可行).您将需要2个Luis模型.

    Here is a potential idea (not sure if it will work though). You would need 2 Luis models.

    • 使用您当前的模型,用户将能够以新的说话方式进行训练.
    • 第二种模式是一种专门旨在由用户以新的意图扩展"的模式.

    如果以此方式分开,则可以查看第二个LUIS模型的插件"体系结构.因此,您的应用程序会以某种方式动态加载第二个模型所在的程序集.

    If you separate this in that way, you might be able to look into a "plugin" architecture for the second LUIS model. So, your app, somehow, loads dinamically an assembly where the second model lives.

    一旦有了适当的设置,您就可以专注于为第二个Luis模型编写后端代码,而不必担心bot/第一个模型.您应该能够用第二个Luis模型替换该程序集,并能够在bot中检测该程序集是否有新版本,并在应用程序域中替换当前的程序集.

    Once you you have that in place, you can focus on writing the backend code for your second Luis Model without having to worry about the bot/first model. You should be able to replace the assembly with the second Luis Model and be able in the bot to detect if there is new version of that assembly and replace the current one in the app domain.

    正如我所说,这只是我与您集思广益的想法.听起来有点复杂,但并不能解决您的所有问题;因为您仍然需要编写代码(无论如何,您最终都必须这样做)

    As I said, is just an idea as I'm brainstorming with you. Sounds a bit complex, and it's not addressing all your concerns; as you still will need to write code (which in any case, you will eventually have to do)

    这篇关于为LUIS.AI创建API或使用.JSON文件,以便为非技术用户培训机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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