Creating and training LUIS models on the [website] (www.luis.ai) can be slow and frustrating.
Instead you can use this framework which uses the LUIS API to train your models in a much simpler, meta-data driven way.
-
Setup Config
- Add your subscription_key in config.json (subscription key for LUIS. You can find your's [here] (https://www.luis.ai/Home/UserSettings)
- Add your App Name, App Description and appID. (LUIS app name and appId)
If it's a new app and you don't have an id, put appId as None
-
Create Intents
- To create a intent just create a .txt file in the intents folder with the filename as the name of the intent.
You can add all the utterances or examples for this intent in this .txt, each on a seperate line.
- To create a intent just create a .txt file in the intents folder with the filename as the name of the intent.
-
Create Entities
-
To create a entity add a json object to the array of the entities field in the config.json file with the following schema
{ "name" : name of entity} -
To add the entity to a training example, put paranthesis around the example and then list
the entity names after the example seperated by '<=>'
eg: "Book a (Delta) flight from (NYC) to (Miami) <=> airlines <=> destination <=> destination"The order of entity names should be in the order in which they occur in the statement.
Note: Currently it doesn't work for hierarchial or composite entities.
-
-
Create Phraselists
- To create a phraselist add a json object to the array of the phraselists field in config.json file
with the following schema
{
"name" : name of phraselist ,
"mode" : exchangable or non-exchangable,
"phrases" : [comma seperated strings of phrases]
}
- To create a phraselist add a json object to the array of the phraselists field in config.json file
with the following schema
-
Train/Build the LUIS Model
- CD into code folder and run main.py ($ python main.py)
After following the above steps, you can visit the application portal and you will find your application built and trained.
You can keep making changes to your intent files/ entities/ phraselists any number of times you want. Just run main.py and your model will be retrained with the changes.
Feel free to report bugs, issues or send in pull requests.
MIT License