- Notifications
You must be signed in to change notification settings - Fork4
Microsoft Luis.ai API Golang package
License
kkdai/luis
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
LUIS lets your app understand language
- LUIS is in beta and free to use
- Supported browsers: Internet Explorer 10/11, Chrome
In LUIS you can:
- Create language understanding models.
- Use pre-built, world-class models from Bing and Cortana.
- Deploy your models to an HTTP endpoint.
- Activate models on any device.
Here is some suggestion and limitation you might want to check before add all you intent.Chinese
Login and go to LUIS key pagehttps://www.luis.ai/home/keys
You can see theAPI_KEY
in "My Keys".
Create a new App (if you don't have one) and in the APP dashboard, you can getAPP_ID
from web URL. It might be12341be8-8cfb-471c-b05a-636d58cd5678
Before use this SDK, you must run follow step in luis.ai dashboard.
- Create new app
- Add few intent
- Add
Endpoint Key
(You could use your API key) - Publish your model.
go get github.com/kkdai/luis
varAPI_KEYstringvarAPPIDstringfuncmain() {varAPI_KEYstringvarAPPIDstringAPPID=os.Getenv("APP_ID")API_KEY=os.Getenv("SUB_KEY")ifAPI_KEY=="" {fmt.Println("Please export your key to environment first, `export SUB_KEY=12234 && export APP_ID=5678`")}ifAPI_KEY=="" {return}e:=NewLuis(API_KEY,APPID)res,err:=e.IntelList()iferr!=nil {log.Error("Error happen on :",err.Err)}fmt.Println("Got response:",string(res))result:=NewIntentListResponse(res)fmt.Println("Luis Intent Ret",result)//Add utterancesex:=ExampleJson{ExampleText:"test",SelectedIntentName:"test2"}res,err=e.AddLabel(ex)//Train itres,err=e.Train()iferr!=nil {log.Error("Error happen on :",err.Err)}//Predict it, once you have train your models.res,err=e.Predict("test string")iferr!=nil {log.Error("Error happen on :",err.Err)}fmt.Println("Got response:",string(res))fmt.Println("Get the best predict result:",GetBestScoreIntent(NewPredictResponse(res)))}
- actionChannels
- intents
- predict
- train
- example
- Versions
- Publish
Need your help to send your PR.
Please open up an issue on GitHub before you put a lot efforts on pull request.The code submitting to PR must be filtered withgofmt
This package is licensed under MIT license. See LICENSE for details.
About
Microsoft Luis.ai API Golang package
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.