Creating an API for LUIS.AI or using .JSON files to train a bot for non-technical users

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

Everything is fine, except that I need to provide an opportunity for non-technical users to train the bot and teach it new things , i.e. new intentions in LUIS.ai.

In other words, suppose that right now the bot can respond to messages like "Hey, bot, where can I get coffee" and "Where can I buy clothes" with simple phrases that contain instructions. Non-technical users should be able to train him to answer "Where can I get some food."

Here is what I reviewed:

  • Continuing to use LUIS.ai. It does not work because LUIS.ai does not have an API. The best he has is a graphical interface for improving existing intentions and the function of adding applications / phrases. A process can be semi-automated if the JSON file with the application can be generated by some application that I am writing; however, there still needs to be inline code that handles new intentions, and this should be implemented by a C # encoder.

    Can it work if I switch from C # to Node.js? Then theoretically, I could automatically generate code files / intentional handlers.

  • Azure Bot Service. It doesn't seem to have a non-technical interface, and it's just a browser-based embedded environment.

  • The dividing platform Bot and the use of third-party tools such as motion.ai. It does not work because there is no “intelligence” like the one provided by LUIS.ai.

  • Using the forms stream, which is part of the Bot platform. If my GUI bot application can generate JSON files, these files can be used by the Bot Framework to automatically create a bot. It does not work, because there is no intelligence, as in LUIS.ai.

  • Continue to use the Bot Framework, but start LUIS and create a separate web service based on the Node.js processing library to determine your intentions. May or may not work, may be less smart than LUIS, and may be redundant.

  • Override the method in LuisDialog that selects the intent from LuisResponse to use my own way of defining the intent (but how?).

At this point, I have no ideas, and any pointers would be greatly appreciated.

+5
source share
2 answers

First of all, LUIS.ai provides an API that you can use to automate learning. What's more, here is a Luis Trainer, written entirely in Python against an API that simply does this.

The simplest may be the one you describe in # 1: you can automate training (as explained above), but you still have to deploy a new version of the bot if new intentions are provided. It’s one thing to give users the opportunity to teach the existing model new notations, and another is completely different to let them create a model :)

It might be difficult to skip the code for the backend (I would not have automated it at all)

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

  • One with your current model that users will be able to train with new sayings.
  • The second model is the one designed solely to “expand” with new user intentions.

If you separate it this way, you can look into the plug-in architecture for the second LUIS model. So, your application somehow dynamically loads the assembly where the second model lives.

Once you have this in place, you can focus on writing code for the second Luis model without having to worry about the bot / first model. You should be able to replace the assembly with a second Luis model and be able to detect in the bot whether there is a new version of this assembly and replace it in the application domain.

As I said, this is just an idea, as I am brainstorming with you. It sounds a little complicated, and this does not apply to all your problems; since you still have to write code (which you have to do anyway)

+6
source

I am working on a project assignment (training) to automate the creation of chatbots specifically designed for the Luis.ai model using simple old javascript and web services for Louis.

I looked at the Bot Framework, and this is too cumbersome to automate (I want the X number of clients to create a chat bot without encoding). I also want to add my own type of "Maps" (html widgets) that do more and can be easily customized by someone with zero coding skills.

Calls to the Luis.ai/Cognitive Services API are made in my code, and the json response goes back to my own rule engine. In the following URL, click the LUIS API link on the page to open the Luis API console where you can test and train your model. All the endpoints you need are here ...

https://dev.projectoxford.ai/docs/services/

Based on the various endpoints on this page, you can use WebClient in asp.net to cancel the response. Therefore, in my testing, I have buttons on the page to push statements to the model, drop objects, create hierarchical objects, and so on. Take a look at http://onlinebotbuilder.com to find out how the intent of the product basket is dynamically inserted.

When your tool is built and the statements begin, Luis.ai will save them, and on the "Recommendations" tab (in Luis.ai) he will ask you to give directions ... Unfortunately, I do not think you could give it control their clients, if they are not experts in your domain (they understand which statement refers to which intention). You do not need to take the application down, just train it periodically to improve the model based on your customers input ... soon enough you will have a good model based on your intentions.

Hope this helps.

0
source

Source: https://habr.com/ru/post/1260852/


All Articles