├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── authoring-routes.md ├── azuredeploy.json ├── bot-integration-samples └── hotel-finder │ ├── README.md │ ├── csharp │ ├── App_Start │ │ └── WebApiConfig.cs │ ├── Controllers │ │ └── MessagesController.cs │ ├── Dialogs │ │ └── RootLuisDialog.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Hotel.cs │ ├── HotelsQuery.cs │ ├── LuisBot.csproj │ ├── LuisBot.json │ ├── LuisBot.sln │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ ├── Services │ │ ├── BingSpellCheckError.cs │ │ ├── BingSpellCheckFlaggedToken.cs │ │ ├── BingSpellCheckResponse.cs │ │ ├── BingSpellCheckService.cs │ │ └── BingSpellCheckSuggestion.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── azuredeploy.json │ ├── default.htm │ ├── images │ │ ├── bot-emulator-result.png │ │ ├── bot-screenshot.png │ │ ├── highlights-phrase.png │ │ ├── highlights-regex.png │ │ ├── import-new-app.png │ │ ├── outcome.png │ │ ├── prereqs-apikey.png │ │ ├── prereqs-appid.png │ │ └── prereqs-import.png │ └── packages.config │ └── nodejs │ ├── .env │ ├── LuisBot.json │ ├── README.md │ ├── app.js │ ├── azuredeploy.json │ ├── images │ ├── highlights-phrase.png │ ├── highlights-regex.png │ ├── outcome.png │ ├── prereqs-import.png │ └── prereqs-publish.png │ ├── package.json │ ├── spell-service.js │ └── store.js ├── community-projects.md ├── documentation-samples ├── Examples-BookFlight │ ├── readme.md │ ├── travel-agent-sample-01.json │ ├── travel-agent-sample-02.json │ └── utterance-to-upload.json ├── Examples-Colors │ ├── README.md │ └── sample-choose-color-01.json ├── archive-authoring-api-samples │ ├── README.md │ ├── csharp │ │ ├── ConsoleApp1.sln │ │ ├── ConsoleApp1 │ │ │ ├── App.config │ │ │ ├── ConsoleApp1.csproj │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── utterances.json │ │ ├── add-utterances.cs │ │ └── utterances.json │ ├── go │ │ ├── add-utterances.go │ │ └── utterances.json │ ├── java │ │ ├── AddUtterances.java │ │ ├── gson-2.8.2.jar │ │ ├── travel-agent-sample-02.json │ │ ├── utterance-to-upload.json │ │ ├── utterances.json │ │ └── utterances.results.json │ ├── javascript │ │ └── add-utterance.html │ ├── node │ │ ├── add-single-utterance.js │ │ ├── add-utterances.js │ │ ├── build-app-programmatically-csv │ │ │ ├── IoT.csv │ │ │ ├── _create.js │ │ │ ├── _download.js │ │ │ ├── _entities.js │ │ │ ├── _intents.js │ │ │ ├── _parse.js │ │ │ ├── _upload.js │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── package.json │ │ ├── travel-agent-sample-02.json │ │ ├── utterance-to-upload.json │ │ └── utterances.json │ ├── php │ │ ├── add-utterances.php │ │ └── utterances.json │ ├── python │ │ ├── add-utterances-3-6.py │ │ ├── travel-agent-sample-02.json │ │ ├── utterance-to-upload.json │ │ └── utterances.json │ └── ruby │ │ ├── add-utterances.rb │ │ └── utterances.json ├── archive-endpoint-api-samples │ ├── README.md │ ├── csharp │ │ └── Program.cs │ ├── go │ │ └── endpoint.go │ ├── java │ │ ├── Dockerfile │ │ ├── call-endpoint.java │ │ ├── command-line.png │ │ ├── lib │ │ │ ├── commons-logging-1.2.jar │ │ │ ├── httpclient-4.5.3.jar │ │ │ └── httpcore-4.4.6.jar │ │ └── readme.md │ ├── javascript │ │ └── call-endpoint.html │ ├── node │ │ ├── .env │ │ ├── Dockerfile │ │ ├── call-endpoint.js │ │ ├── command-line.png │ │ ├── package.json │ │ └── readme.md │ ├── php │ │ └── endpoint-call.php │ ├── python │ │ ├── quickstart-call-endpoint-2-7.py │ │ └── quickstart-call-endpoint-3-6.py │ └── ruby │ │ └── endpoint-call.rb ├── authoring-api-samples │ ├── README.md │ ├── TravelAgent.json │ ├── csharp-core │ │ └── change-model │ │ │ ├── Dockerfile │ │ │ ├── Program.cs │ │ │ ├── change-model.csproj │ │ │ └── utterances.json │ ├── csharp │ │ ├── ConsoleApp1.sln │ │ └── ConsoleApp1 │ │ │ ├── App.config │ │ │ ├── ConsoleApp1.csproj │ │ │ ├── ConsoleOutput.txt │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ ├── packages.config │ │ │ └── utterances.json │ ├── go │ │ ├── Dockerfile │ │ ├── add-utterances.go │ │ └── utterances.json │ ├── java │ │ ├── AddUtterances.java │ │ ├── Dockerfile │ │ ├── lib │ │ │ └── gson-2.8.2.jar │ │ └── utterances.json │ ├── javascript │ │ └── add-utterance.html │ ├── node │ │ ├── Dockerfile │ │ ├── add-utterances.js │ │ ├── package.json │ │ └── utterances.json │ ├── php │ │ ├── Dockerfile │ │ ├── add-utterances.php │ │ └── utterances.json │ ├── python │ │ ├── 3.x │ │ │ ├── Dockerfile │ │ │ ├── add-utterances-3-6.py │ │ │ └── utterances.json │ │ └── add-utterances-3-6.py │ ├── ruby │ │ ├── Dockerfile │ │ ├── add-utterances.rb │ │ └── utterances.json │ └── utterances.json ├── endpoint-api-samples │ ├── README.md │ ├── csharp-core │ │ └── analyze-text │ │ │ ├── Dockerfile │ │ │ ├── Program.cs │ │ │ └── analyze-text.csproj │ ├── csharp │ │ └── Program.cs │ ├── go │ │ ├── Dockerfile │ │ └── endpoint.go │ ├── java │ │ ├── Dockerfile │ │ ├── call-endpoint.java │ │ ├── command-line.png │ │ ├── lib │ │ │ ├── commons-logging-1.2.jar │ │ │ ├── httpclient-4.5.3.jar │ │ │ └── httpcore-4.4.6.jar │ │ └── readme.md │ ├── javascript │ │ └── call-endpoint.html │ ├── node │ │ ├── .env │ │ ├── Dockerfile │ │ ├── call-endpoint.js │ │ ├── command-line.png │ │ ├── package.json │ │ └── readme.md │ ├── php │ │ ├── Dockerfile │ │ └── endpoint-call.php │ ├── python │ │ ├── 2.x │ │ │ ├── Dockerfile │ │ │ └── quickstart-call-endpoint-2-7.py │ │ ├── 3.x │ │ │ ├── Dockerfile │ │ │ └── quickstart-call-endpoint-3-6.py │ │ ├── quickstart-call-endpoint-2-7.py │ │ └── quickstart-call-endpoint-3-6.py │ └── ruby │ │ ├── Dockerfile │ │ └── endpoint-call.rb ├── entity │ └── list │ │ └── import-example.json ├── examples-IoT │ ├── IoT Quickstart with Prebuilt Domain.json │ └── readme.md ├── find-region │ ├── csharp │ │ ├── ConsoleAppLUISRegion.sln │ │ ├── ConsoleAppLUISRegion │ │ │ ├── ConsoleAppLUISRegion.csproj │ │ │ └── Program.cs │ │ └── readme.md │ └── nodejs │ │ ├── index.js │ │ ├── package.json │ │ └── readme.md ├── phrase_list │ └── interchangeable │ │ ├── luis-app-after-phrase-list.json │ │ └── luis-app-before-phrase-list.json ├── quickstarts │ ├── analyze-text │ │ ├── README.md │ │ ├── csharp-core │ │ │ └── analyze-text │ │ │ │ ├── Dockerfile │ │ │ │ ├── Program.cs │ │ │ │ └── analyze-text.csproj │ │ ├── csharp │ │ │ ├── Program.cs │ │ │ └── README.md │ │ ├── go │ │ │ ├── Dockerfile │ │ │ └── endpoint.go │ │ ├── java │ │ │ ├── Dockerfile │ │ │ ├── call-endpoint.java │ │ │ ├── command-line.png │ │ │ ├── lib │ │ │ │ ├── commons-logging-1.2.jar │ │ │ │ ├── httpclient-4.5.3.jar │ │ │ │ └── httpcore-4.4.6.jar │ │ │ └── readme.md │ │ ├── javascript │ │ │ └── call-endpoint.html │ │ ├── node │ │ │ ├── .env │ │ │ ├── Dockerfile │ │ │ ├── call-endpoint.js │ │ │ ├── command-line.png │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── php │ │ │ ├── Dockerfile │ │ │ └── endpoint-call.php │ │ ├── python │ │ │ ├── 2.x │ │ │ │ ├── Dockerfile │ │ │ │ └── quickstart-call-endpoint-2-7.py │ │ │ └── 3.x │ │ │ │ ├── Dockerfile │ │ │ │ └── quickstart-call-endpoint-3-6.py │ │ └── ruby │ │ │ ├── Dockerfile │ │ │ └── endpoint-call.rb │ ├── change-model │ │ ├── README.md │ │ ├── TravelAgent.json │ │ ├── csharp-core │ │ │ └── change-model │ │ │ │ ├── Dockerfile │ │ │ │ ├── Program.cs │ │ │ │ ├── change-model.csproj │ │ │ │ └── utterances.json │ │ ├── csharp │ │ │ ├── ConsoleApp1.sln │ │ │ ├── ConsoleApp1 │ │ │ │ ├── App.config │ │ │ │ ├── ConsoleApp1.csproj │ │ │ │ ├── ConsoleOutput.txt │ │ │ │ ├── Program.cs │ │ │ │ ├── Properties │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ ├── packages.config │ │ │ │ └── utterances.json │ │ │ └── README.md │ │ ├── go │ │ │ ├── Dockerfile │ │ │ ├── add-utterances.go │ │ │ └── utterances.json │ │ ├── java │ │ │ ├── AddUtterances.java │ │ │ ├── Dockerfile │ │ │ ├── lib │ │ │ │ └── gson-2.8.2.jar │ │ │ └── utterances.json │ │ ├── javascript │ │ │ └── add-utterance.html │ │ ├── node │ │ │ ├── Dockerfile │ │ │ ├── add-utterances.js │ │ │ ├── package.json │ │ │ └── utterances.json │ │ ├── php │ │ │ ├── Dockerfile │ │ │ ├── add-utterances.php │ │ │ └── utterances.json │ │ ├── python │ │ │ └── 3.x │ │ │ │ ├── Dockerfile │ │ │ │ ├── add-utterances-3-6.py │ │ │ │ └── utterances.json │ │ ├── ruby │ │ │ ├── Dockerfile │ │ │ ├── add-utterances.rb │ │ │ └── utterances.json │ │ └── utterances.json │ ├── in-portal │ │ └── build-portal-app.json │ └── job-phrase-list.csv ├── readme.md ├── sdk-quickstarts │ ├── c# │ │ ├── BuildModel │ │ │ ├── BuildModel.sln │ │ │ └── BuildModel │ │ │ │ ├── BuildModel.csproj │ │ │ │ └── Program.cs │ │ └── UsePredictionRuntime │ │ │ ├── UsePredictionRuntime.sln │ │ │ └── UsePredictionRuntime │ │ │ ├── Program.cs │ │ │ └── UsePredictionRuntime.csproj │ └── readme.md ├── tutorial-batch-testing │ ├── HumanResources-entities-batch.json │ └── HumanResources-jobs-batch.json ├── tutorial-list-entity │ ├── add-entity-list.js │ ├── package.json │ ├── publish.js │ ├── query.js │ └── train.js ├── tutorial-speech-intent-recognition │ ├── console-output.txt │ ├── csharp │ │ ├── App.config │ │ ├── HumanResources.json │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── csharp_samples.csproj │ │ ├── csharp_samples.sln │ │ └── packages.config │ └── readme.md ├── tutorial-web-app-bot-application-insights │ ├── csharp │ │ ├── BasicLuisDialog.cs │ │ └── MessagesController.cs │ ├── nodejs │ │ └── app.js │ └── v4 │ │ ├── luis-csharp-bot-johnsmith-src-telemetry │ │ ├── .deployment │ │ ├── .gitignore │ │ ├── AdapterWithErrorHandler.cs │ │ ├── BookingDetails.cs │ │ ├── Bots │ │ │ ├── DialogAndWelcomeBot.cs │ │ │ └── DialogBot.cs │ │ ├── Cards │ │ │ └── welcomeCard.json │ │ ├── CognitiveModels │ │ │ └── FlightBooking.json │ │ ├── ConfigurationCredentialProvider.cs │ │ ├── Controllers │ │ │ └── BotController.cs │ │ ├── CoreBot.csproj │ │ ├── CoreBot.deps.json │ │ ├── CoreBot.runtimeconfig.json │ │ ├── CoreBot.sln │ │ ├── DialogExtensions.cs │ │ ├── Dialogs │ │ │ ├── BookingDialog.cs │ │ │ ├── CancelAndHelpDialog.cs │ │ │ ├── DateResolverDialog.cs │ │ │ └── MainDialog.cs │ │ ├── Directory.Build.props │ │ ├── LuisHelper.cs │ │ ├── PostDeployScripts │ │ │ ├── IncludeSources.targets │ │ │ ├── githubProject.json.template │ │ │ ├── mergeSettings.js │ │ │ ├── prepareSrc.cmd │ │ │ ├── publish.cmd.template │ │ │ ├── publishProfile.xml.template │ │ │ ├── publishSettings.xml.template │ │ │ ├── runGulp.cmd │ │ │ ├── setupGithubRemoteRepo.cmd │ │ │ ├── setupVsoRemoteRepo.cmd │ │ │ └── vsoProject.json.template │ │ ├── Program.cs │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── build.cmd │ │ ├── deploy.cmd │ │ ├── publish.cmd │ │ ├── web.config │ │ └── wwwroot │ │ │ └── default.htm │ │ └── luis-nodejs-bot-johnsmith-src-telemetry │ │ ├── .deployment │ │ ├── .env │ │ ├── .eslintrc.js │ │ ├── .gitignore │ │ ├── .vscode │ │ └── launch.json │ │ ├── PostDeployScripts │ │ ├── githubProject.json.template │ │ ├── mergeSettings.js │ │ ├── prepareSrc.cmd │ │ ├── publish.js.template │ │ ├── runGulp.cmd │ │ ├── setupGithubRemoteRepo.cmd │ │ ├── setupVsoRemoteRepo.cmd │ │ └── vsoProject.json.template │ │ ├── README.md │ │ ├── appInsightsLog.js │ │ ├── bots │ │ ├── dialogAndWelcomeBot.js │ │ ├── dialogBot.js │ │ └── resources │ │ │ └── welcomeCard.json │ │ ├── cognitiveModels │ │ └── FlightBooking.json │ │ ├── deploy.cmd │ │ ├── dialogs │ │ ├── bookingDialog.js │ │ ├── cancelAndHelpDialog.js │ │ ├── dateResolverDialog.js │ │ ├── luisHelper.js │ │ └── mainDialog.js │ │ ├── iisnode.yml │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── publish.cmd │ │ └── web.config ├── tutorial-web-app-bot │ ├── csharp │ │ ├── BasicLuisDialog.cs │ │ └── Default_BasicLuisDialog.cs │ ├── nodejs │ │ └── app.js │ ├── readme.md │ └── v4 │ │ ├── luis-csharp-bot-johnsmith-src │ │ ├── .deployment │ │ ├── .gitignore │ │ ├── AdapterWithErrorHandler.cs │ │ ├── BookingDetails.cs │ │ ├── Bots │ │ │ ├── DialogAndWelcomeBot.cs │ │ │ └── DialogBot.cs │ │ ├── Cards │ │ │ └── welcomeCard.json │ │ ├── CognitiveModels │ │ │ └── FlightBooking.json │ │ ├── ConfigurationCredentialProvider.cs │ │ ├── Controllers │ │ │ └── BotController.cs │ │ ├── CoreBot.csproj │ │ ├── CoreBot.deps.json │ │ ├── CoreBot.runtimeconfig.json │ │ ├── CoreBot.sln │ │ ├── DialogExtensions.cs │ │ ├── Dialogs │ │ │ ├── BookingDialog.cs │ │ │ ├── CancelAndHelpDialog.cs │ │ │ ├── DateResolverDialog.cs │ │ │ └── MainDialog.cs │ │ ├── Directory.Build.props │ │ ├── LuisHelper.cs │ │ ├── PostDeployScripts │ │ │ ├── IncludeSources.targets │ │ │ ├── githubProject.json.template │ │ │ ├── mergeSettings.js │ │ │ ├── prepareSrc.cmd │ │ │ ├── publish.cmd.template │ │ │ ├── publishProfile.xml.template │ │ │ ├── publishSettings.xml.template │ │ │ ├── runGulp.cmd │ │ │ ├── setupGithubRemoteRepo.cmd │ │ │ ├── setupVsoRemoteRepo.cmd │ │ │ └── vsoProject.json.template │ │ ├── Program.cs │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── appsettings.json │ │ ├── build.cmd │ │ ├── deploy.cmd │ │ ├── publish.cmd │ │ ├── web.config │ │ └── wwwroot │ │ │ └── default.htm │ │ └── luis-nodejs-bot-johnsmith-src │ │ ├── .deployment │ │ ├── .eslintrc.js │ │ ├── .gitignore │ │ ├── PostDeployScripts │ │ ├── githubProject.json.template │ │ ├── mergeSettings.js │ │ ├── prepareSrc.cmd │ │ ├── publish.js.template │ │ ├── runGulp.cmd │ │ ├── setupGithubRemoteRepo.cmd │ │ ├── setupVsoRemoteRepo.cmd │ │ └── vsoProject.json.template │ │ ├── README.md │ │ ├── bots │ │ ├── dialogAndWelcomeBot.js │ │ ├── dialogBot.js │ │ └── resources │ │ │ └── welcomeCard.json │ │ ├── cognitiveModels │ │ └── FlightBooking.json │ │ ├── deploy.cmd │ │ ├── dialogs │ │ ├── bookingDialog.js │ │ ├── cancelAndHelpDialog.js │ │ ├── dateResolverDialog.js │ │ ├── luisHelper.js │ │ └── mainDialog.js │ │ ├── iisnode.yml │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── publish.cmd │ │ └── web.config └── tutorials │ ├── HumanResources-entities-batch.json │ ├── HumanResources-jobs-batch.json │ ├── HumanResources.json │ ├── MyCommunicator.json │ ├── MyStore.json │ ├── build-app │ ├── intentonly.json │ ├── job-phrase-list.csv │ ├── tutorial_composite.json │ ├── tutorial_hierarchic.json │ ├── tutorial_intentonly.json │ ├── tutorial_list.json │ ├── tutorial_prebuilt.json │ ├── tutorial_regex.json │ ├── tutorial_sentiment.json │ └── tutorial_simple.json │ ├── custom-domain-batchtest-HumanResources.json │ ├── custom-domain-composite-HumanResources.json │ ├── custom-domain-hier-HumanResources.json │ ├── custom-domain-intent-only-HumanResources.json │ ├── custom-domain-keyphrase-HumanResources.json │ ├── custom-domain-list-HumanResources.json │ ├── custom-domain-pattern-roles-HumanResources.json │ ├── custom-domain-patterns-HumanResources-before-pattern-after-utterances.json │ ├── custom-domain-patterns-HumanResources-v2.json │ ├── custom-domain-patterns-HumanResources.json │ ├── custom-domain-patterns-any-HumanResources.json │ ├── custom-domain-prebuilts-HumanResources.json │ ├── custom-domain-regex-HumanResources.json │ ├── custom-domain-review-HumanResources.json │ ├── custom-domain-sentiment-HumanResources.json │ ├── custom-domain-simple-HumanResources.json │ ├── endpoint-utterances-Human-Resources.json │ ├── job-phrase-list.csv │ └── machine-learned-entity │ ├── pizza-intents-only.json │ ├── pizza-intents-only.lu │ ├── pizza-tutorial-with-entities.json │ └── pizza-tutorials-with-entities.lu ├── examples ├── README.md ├── async-query-log │ └── nodejs │ │ ├── README.md │ │ ├── getQueryLog.js │ │ └── package.json ├── azure-function-application-insights-endpoint │ ├── function.json │ ├── media │ │ ├── appInsights.png │ │ ├── dependency-details.png │ │ ├── portal.png │ │ └── search.png │ ├── project.json │ ├── readme.md │ ├── results.json │ ├── run.csx │ └── run.original.csx ├── azure-function-endpoint │ ├── function-app-vs.png │ ├── function.json │ ├── readme.md │ └── run.csx ├── backup │ ├── .gitignore │ ├── backup.js │ ├── find.js │ ├── package.json │ └── readme.md ├── bing-spell-check │ └── javascript │ │ ├── call-endpoint.html │ │ ├── readme.md │ │ └── screenshot.png ├── build-app-programmatically-csv │ ├── IoT.csv │ ├── README.md │ ├── _create.js │ ├── _download.js │ ├── _entities.js │ ├── _intents.js │ ├── _parse.js │ ├── _upload.js │ ├── images │ │ ├── csv.png │ │ ├── download-querylog.png │ │ └── imported-utterances.png │ ├── index.js │ └── package.json ├── createFromPrebuiltDomain │ ├── index.js │ └── package.json ├── demo-upload-endpoint-utterances │ ├── endpoint.js │ └── package.json ├── demo-upload-example-utterances │ ├── README.md │ ├── demo-Upload-utterances-from-querylog │ │ ├── README.md │ │ ├── _download.js │ │ ├── _parse.js │ │ ├── _upload.js │ │ ├── example-files │ │ │ ├── utterances.csv │ │ │ ├── utterances.json │ │ │ └── utterances.upload.json │ │ ├── index.js │ │ ├── media │ │ │ └── download-querylog.png │ │ └── package.json │ └── demo-upload-utterances-from-exported-luis-app │ │ ├── README.md │ │ ├── _parse.js │ │ ├── _upload.js │ │ ├── example-files │ │ ├── app_defintion.json │ │ ├── exported-luis-app-utterances.json │ │ ├── utterances.json │ │ └── utterances.upload.json │ │ ├── index.js │ │ ├── media │ │ └── export-app-data.png │ │ └── package.json ├── deprecated │ ├── README.md │ └── pattern-feature │ │ ├── README.md │ │ └── hyphenated-names.json ├── example-app-models │ ├── 1.x │ │ └── LuisBot.json │ └── custom │ │ ├── FoodTruck.json │ │ ├── HomeAutomation.json │ │ └── TravelAgent.json ├── notes-app │ ├── csharp │ │ ├── NoteApp.sln │ │ ├── NoteApp │ │ │ ├── NoteApp.csproj │ │ │ └── Program.cs │ │ └── readme.md │ └── node │ │ ├── .env │ │ ├── Dockerfile │ │ ├── notes.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── readme.md ├── phrase_list │ ├── Phrase_List.json │ ├── README.md │ └── screenshots │ │ ├── AddingValuestoWantPhraseList.PNG │ │ ├── IRequireAComputerReplacement_AfterPhraseList.PNG │ │ ├── IRequireAComputerReplacement_BeforePhraseList.PNG │ │ ├── PhraseListStart.PNG │ │ └── PhraseList_RelatedValues.PNG ├── simple-bot-example │ ├── FirstSimpleBotExample.json │ ├── README.md │ └── WeatherOrHomeAutomation.json └── upgrading_luis_tier │ └── README.md └── media └── docker-logo.png /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | > Please provide us with the following information: 5 | > --------------------------------------------------------------- 6 | 7 | ### This issue is for a: (mark with an `x`) 8 | ``` 9 | - [ ] bug report -> please search issues before submitting 10 | - [ ] feature request 11 | - [ ] documentation issue or request 12 | - [ ] regression (a behavior that used to work and stopped in a new release) 13 | ``` 14 | 15 | ### Minimal steps to reproduce 16 | > 17 | 18 | ### Any log messages given by the failure 19 | > 20 | 21 | ### Expected/desired behavior 22 | > 23 | 24 | ### OS and Version? 25 | > Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) 26 | 27 | ### Versions 28 | > 29 | 30 | ### Mention any other details that might be useful 31 | 32 | > --------------------------------------------------------------- 33 | > Thanks! We'll be in touch soon. 34 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | 3 | * ... 4 | 5 | ## Does this introduce a breaking change? 6 | 7 | ``` 8 | [ ] Yes 9 | [ ] No 10 | ``` 11 | 12 | ## Pull Request Type 13 | What kind of change does this Pull Request introduce? 14 | 15 | 16 | ``` 17 | [ ] Bugfix 18 | [ ] Feature 19 | [ ] Code style update (formatting, local variables) 20 | [ ] Refactoring (no functional changes, no api changes) 21 | [ ] Documentation content changes 22 | [ ] Other... Please describe: 23 | ``` 24 | 25 | ## How to Test 26 | * Get the code 27 | 28 | ``` 29 | git clone [repo-address] 30 | cd [repo-name] 31 | git checkout [branch-name] 32 | npm install 33 | ``` 34 | 35 | * Test the code 36 | 37 | ``` 38 | ``` 39 | 40 | ## What to Check 41 | Verify that the following are valid 42 | * ... 43 | 44 | ## Other Information 45 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [project-title] Changelog 2 | 3 | 4 | # x.y.z (yyyy-mm-dd) 5 | 6 | *Features* 7 | * ... 8 | 9 | *Bug Fixes* 10 | * ... 11 | 12 | *Breaking Changes* 13 | * ... 14 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot 2 | { 3 | using System.Web.Http; 4 | using Newtonsoft.Json; 5 | using Newtonsoft.Json.Serialization; 6 | 7 | public static class WebApiConfig 8 | { 9 | public static void Register(HttpConfiguration config) 10 | { 11 | // Json settings 12 | config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; 13 | config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); 14 | config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; 15 | JsonConvert.DefaultSettings = () => new JsonSerializerSettings() 16 | { 17 | ContractResolver = new CamelCasePropertyNamesContractResolver(), 18 | Formatting = Newtonsoft.Json.Formatting.Indented, 19 | NullValueHandling = NullValueHandling.Ignore, 20 | }; 21 | 22 | // Web API configuration and services 23 | 24 | // Web API routes 25 | config.MapHttpAttributeRoutes(); 26 | 27 | config.Routes.MapHttpRoute( 28 | name: "DefaultApi", 29 | routeTemplate: "api/{controller}/{id}", 30 | defaults: new { id = RouteParameter.Optional }); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="LuisBot.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Global.asax.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot 2 | { 3 | using System.Web.Http; 4 | 5 | public class WebApiApplication : System.Web.HttpApplication 6 | { 7 | protected void Application_Start() 8 | { 9 | GlobalConfiguration.Configure(WebApiConfig.Register); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Hotel.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot 2 | { 3 | using System; 4 | 5 | [Serializable] 6 | public class Hotel 7 | { 8 | public string Name { get; set; } 9 | 10 | public int Rating { get; set; } 11 | 12 | public int NumberOfReviews { get; set; } 13 | 14 | public int PriceStarting { get; set; } 15 | 16 | public string Image { get; set; } 17 | 18 | public string Location { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/HotelsQuery.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot 2 | { 3 | using System; 4 | using Microsoft.Bot.Builder.FormFlow; 5 | 6 | [Serializable] 7 | public class HotelsQuery 8 | { 9 | [Prompt("Please enter your {&}")] 10 | [Optional] 11 | public string Destination { get; set; } 12 | 13 | [Prompt("Near which Airport")] 14 | [Optional] 15 | public string AirportCode { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/LuisBot.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LuisBot", "LuisBot.csproj", "{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "README", "README", "{279E48A0-6E78-4007-96B3-B018169997BE}" 9 | ProjectSection(SolutionItems) = preProject 10 | README.md = README.md 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.Build.0 = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("LuisBot")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("LuisBot")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a8ba1066-5695-4d71-abb4-65e5a5e0c3d4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Services/BingSpellCheckError.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot.Services 2 | { 3 | public class BingSpellCheckError 4 | { 5 | public int StatusCode { get; set; } 6 | 7 | public string Message { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Services/BingSpellCheckFlaggedToken.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot.Services 2 | { 3 | public class BingSpellCheckFlaggedToken 4 | { 5 | public int Offset { get; set; } 6 | 7 | public string Token { get; set; } 8 | 9 | public string Type { get; set; } 10 | 11 | public BingSpellCheckSuggestion[] Suggestions { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Services/BingSpellCheckResponse.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot.Services 2 | { 3 | using Newtonsoft.Json; 4 | 5 | public class BingSpellCheckResponse 6 | { 7 | [JsonProperty("_type")] 8 | public string Type { get; set; } 9 | 10 | public BingSpellCheckFlaggedToken[] FlaggedTokens { get; set; } 11 | 12 | public BingSpellCheckError Error { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Services/BingSpellCheckSuggestion.cs: -------------------------------------------------------------------------------- 1 | namespace LuisBot.Services 2 | { 3 | public class BingSpellCheckSuggestion 4 | { 5 | public string Suggestion { get; set; } 6 | 7 | public double Score { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

LuisBot

9 |

A sample bot using LuisDialog to integrate with a LUIS.ai application.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/bot-emulator-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/bot-emulator-result.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/bot-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/bot-screenshot.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/highlights-phrase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/highlights-phrase.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/highlights-regex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/highlights-regex.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/import-new-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/import-new-app.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/outcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/outcome.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/prereqs-apikey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/prereqs-apikey.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/prereqs-appid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/prereqs-appid.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/images/prereqs-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/csharp/images/prereqs-import.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/csharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/nodejs/.env: -------------------------------------------------------------------------------- 1 | # Bot Framework Variables 2 | MICROSOFT_APP_ID= 3 | MICROSOFT_APP_PASSWORD= 4 | 5 | # This Endpoint Url can be obtained by uploading or creating your model from the LUIS portal, training, and publishing: https://www.luis.ai/ 6 | LUIS_MODEL_URL= 7 | 8 | # 9 | # Please subscribe to create your own key and try it out further. 10 | # Subscription URL: https://www.microsoft.com/cognitive-services/en-us/subscriptions?productId=/products/56ec2df6dbe2d91324586008 11 | BING_SPELL_CHECK_API_KEY= 12 | 13 | # Boolean value to enable correcting the text before processing it 14 | IS_SPELL_CORRECTION_ENABLED=false 15 | -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/nodejs/images/highlights-phrase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/nodejs/images/highlights-phrase.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/nodejs/images/highlights-regex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/nodejs/images/highlights-regex.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/nodejs/images/outcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/nodejs/images/outcome.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/nodejs/images/prereqs-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/nodejs/images/prereqs-import.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/nodejs/images/prereqs-publish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/bot-integration-samples/hotel-finder/nodejs/images/prereqs-publish.png -------------------------------------------------------------------------------- /bot-integration-samples/hotel-finder/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "botbuilder-sample-luis", 3 | "version": "1.0.0", 4 | "description": "Bot Builder Sample - LUIS", 5 | "scripts": { 6 | "start": "node app.js" 7 | }, 8 | "author": "Microsoft Corp.", 9 | "license": "MIT", 10 | "keywords": [ 11 | "botbuilder", 12 | "bots", 13 | "chatbots", 14 | "botbuilder-samples" 15 | ], 16 | "bugs": { 17 | "url": "https://github.com/Microsoft/BotBuilder-Samples/issues" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/Microsoft/BotBuilder-Samples.git" 22 | }, 23 | "dependencies": { 24 | "botbuilder": "^3.8.2", 25 | "dotenv-extended": "^1.0.4", 26 | "request": "^2.79.0", 27 | "restify": "^4.3.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /community-projects.md: -------------------------------------------------------------------------------- 1 | # Community Projects 2 | If you find a open-source project or sample using LUIS, please let us know. 3 | 4 | ## C 5 | * [Alexa using LUIS](https://github.com/suneetnangia/Alexa) 6 | * [Data-driven bot](https://github.com/ClintFrancis/Mobile3/tree/master/Projects/CognitiveServicesBot) 7 | * [HoloLens Bot](https://github.com/ActiveNick/HoloBot) 8 | * [Multi-language bot](https://github.com/desflan/Multi-Language-Bot) 9 | * [SharePoint Admin bot](https://github.com/desflan/Multi-Language-Bot) 10 | * [Slack bot](https://github.com/metsephiri/zach) 11 | 12 | ## Java 13 | 14 | ## Javascript (client-side frameworks) 15 | 16 | ## Nodejs 17 | * [LUIS cli](https://github.com/Telefonica/luis-cli) - Typescript 18 | * [Shopping bot](https://github.com/matthewshim-ms/ShoppingCartBot) 19 | * [Botframework handling smalltalk with LUIS and QnA-Maker](https://github.com/alyssaong1/botframework-smalltalk) 20 | 21 | ## PHP 22 | 23 | ## Python 24 | 25 | ## Ruby 26 | * [SDK](https://github.com/tachyons/luis) 27 | -------------------------------------------------------------------------------- /documentation-samples/Examples-BookFlight/readme.md: -------------------------------------------------------------------------------- 1 | This LUIS app provides a starting point for training and adding utterances. It has the following intents: 2 | * BookFlight 3 | * Weather.GetForecast 4 | * None 5 | 6 | To import the LUIS app, log in to www.luis.ai, go to **My apps**, and click **Import App**. Choose the file travel-agent-sample-01.json and click **Import**. 7 | -------------------------------------------------------------------------------- /documentation-samples/Examples-BookFlight/utterance-to-upload.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/Examples-Colors/README.md: -------------------------------------------------------------------------------- 1 | This LUIS app provides a starting point for training and adding utterances. This LUIS app has a "RequestColorItem" intent that recognizes requests like "Find me a blue shirt" and extracts a color entity. 2 | 3 | To import the LUIS app, log in to www.luis.ai, go to **My apps**, and click **Import App**. Choose the file sample-choose-color-01.json and click **Import**. 4 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/README.md: -------------------------------------------------------------------------------- 1 | ### LUIS Authoring API samples 2 | These samples provides a starting point for using the Authoring API to edit your LUIS app. In each code language example, you need to provide your LUIS programmatic key as well as the ID of the LUIS app you want to edit. 3 | 4 | 5 | * [Node.js example](./node/add-single-utterance.js) 6 | 7 | * [Python 3.6 example](./python/add-single-utterance.js) 8 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/csharp/ConsoleApp1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{D14C33BE-AF26-43B2-A1D3-7937EC111007}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {37BC7E1D-1D65-4175-B89D-342EC125FC3A} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/csharp/ConsoleApp1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/csharp/ConsoleApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConsoleApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConsoleApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d14c33be-af26-43b2-a1d3-7937ec111007")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/csharp/ConsoleApp1/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "book a flight", 15 | "intentName": "BookFlight", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/csharp/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/go/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go lang 1", 4 | "intentName": "None", 5 | "entityLabels": [] 6 | } 7 | , 8 | { 9 | "text": "go lang 2", 10 | "intentName": "None", 11 | "entityLabels": [] 12 | } 13 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/java/gson-2.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/archive-authoring-api-samples/java/gson-2.8.2.jar -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/java/utterance-to-upload.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/java/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/java/utterances.results.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "value": { 4 | "UtteranceText": "go to seattle", 5 | "ExampleId": -5123383 6 | }, 7 | "hasError": false 8 | }, 9 | { 10 | "value": { 11 | "UtteranceText": "book a flight", 12 | "ExampleId": -169157 13 | }, 14 | "hasError": false 15 | } 16 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/node/build-app-programmatically-csv/IoT.csv: -------------------------------------------------------------------------------- 1 | RequestType,Utterance,Operation,Device,Room,timestamp 2 | TurnOn,Turn on the lights,on,lights,,11/09/2017 04:01 PM 3 | TurnOn,Turn the heat on,on,heat,,11/09/2017 03:49 PM 4 | TurnOn,Switch on the kitchen fan,on,fan,kitchen,11/09/2017 03:29 PM 5 | TurnOff,Turn off bedroom lights,off,lights,bedroom,11/09/2017 03:27 PM 6 | TurnOff,Turn off air conditioning,off,air conditioning,,11/09/2017 03:22 PM 7 | TurnOff,kill the lights,,lights,,11/09/2017 02:49 PM 8 | Dim,dim the lights,on,lights,,11/09/2017 02:43 PM 9 | Other,hi how are you,,,,11/09/2017 02:39 PM 10 | Other,answer the phone,,phone,,11/09/2017 01:19 PM 11 | Other,are you there,,,,11/09/2017 01:08 PM 12 | Other,help,,,,11/09/2017 12:40 PM 13 | Other,testing the circuit,,,,11/09/2017 12:39 PM -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/node/build-app-programmatically-csv/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-app-from-csv", 3 | "version": "1.0.0", 4 | "description": "Use Microsoft LUIS Authoring API to build a LUIS app from utterance examples from a CSV format.", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "v-demak", 10 | "license": "ISC", 11 | "dependencies": { 12 | "babyparse": "^0.4.6", 13 | "bluebird": "^3.5.1", 14 | "fs-extra": "^4.0.2", 15 | "line-reader": "^0.4.0", 16 | "request": "^2.83.0", 17 | "request-promise": "^4.2.2", 18 | "requestretry": "^1.12.2" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "add-single-utterance.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "fs-extra": "^5.0.0", 13 | "request": "^2.83.0", 14 | "request-promise": "^4.2.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/node/utterance-to-upload.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/node/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/php/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/python/utterance-to-upload.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/python/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-authoring-api-samples/ruby/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | } 13 | , 14 | { 15 | "text": "book a flight", 16 | "intentName": "BookFlight", 17 | "entityLabels": [] 18 | } 19 | ] -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/README.md: -------------------------------------------------------------------------------- 1 | ### Query endpoint api samples 2 | This sample provides a starting point for querying your LUIS app. In each code language example, you will need to provide your LUIS subscription key for this public LUIS app. 3 | 4 | 5 | - [c# example](./csharp/Program.cs) 6 | - [java example](./java/call-endpoint.java) 7 | - [python 2.7](./python/quickstart-call-endpoint-2-7.py) 8 | - [python 3.6](./python/quickstart-call-endpoint-3-6.py) -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/java/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-java . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-java luis-endpoint-java 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-java luis-endpoint-java tail 11 | 12 | FROM openjdk:7 13 | COPY . /usr/src/LUIS 14 | 15 | COPY lib/ /lib/ 16 | 17 | WORKDIR /usr/src/LUIS 18 | 19 | # rename file to LuisGetRequest.java 20 | RUN cp ./call-endpoint.java ./LuisGetRequest.java 21 | RUN ls 22 | #RUN rm /call-endpoint.java 23 | 24 | # linux moby syntax 25 | RUN javac -cp ":lib/*" LuisGetRequest.java 26 | 27 | ENTRYPOINT ["java", "-cp",":lib/*", "LuisGetRequest"] 28 | -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/java/command-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/archive-endpoint-api-samples/java/command-line.png -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/java/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/archive-endpoint-api-samples/java/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/java/lib/httpclient-4.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/archive-endpoint-api-samples/java/lib/httpclient-4.5.3.jar -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/java/lib/httpcore-4.4.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/archive-endpoint-api-samples/java/lib/httpcore-4.4.6.jar -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/node/.env: -------------------------------------------------------------------------------- 1 | LUIS_APP_ID=df67dcdb-c37d-46af-88e1-8b97951ca1c2 2 | LUIS_SUBSCRIPTION_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-node . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-node luis-endpoint-node 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-node luis-endpoint-node tail 11 | 12 | FROM node:latest 13 | COPY . /usr/src/LUIS 14 | WORKDIR /usr/src/LUIS 15 | RUN npm install 16 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/node/command-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/archive-endpoint-api-samples/node/command-line.png -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "call-endpoint.js", 6 | "scripts": { 7 | "start":"node call-endpoint.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "dotenv": "^4.0.0", 15 | "querystring": "^0.2.0", 16 | "request": "^2.83.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/node/readme.md: -------------------------------------------------------------------------------- 1 | # LUIS Endpoint query with Node.js 2 | 3 | This example calls into the LUIS endpoint of the public IoT LUIS application and returns a query. 4 | 5 | ## Prerequisites 6 | * In .env, change the `LUIS_SUBSCRIPTION_KEY` value to your own LUIS subscription key found under your User account in [LUIS.ai](https://www.luis.ai). 7 | * [Docker](https://www.docker.com/) or [Nodejs](https://nodejs.org) 8 | 9 | ## Run via Docker 10 | You can run this example from a Docker container. 11 | 12 | 1. On the command-line, build the Docker image: 13 | 14 | ``` 15 | docker build --no-cache -t luis-endpoint-node . 16 | ``` 17 | 18 | 2. On the command-line, run the Docker image: 19 | 20 | ``` 21 | docker run -it --rm --name luis-endpoint-node luis-endpoint-node tail 22 | ``` 23 | 24 | ![Example of Docker commands and output](./command-line.png) 25 | 26 | ## Run via Node 27 | You can run this example from Node.js. 28 | 29 | 1. On the command-line, install dependencies: 30 | 31 | ``` 32 | npm install 33 | ``` 34 | 35 | 3. On the command-line, run the file: 36 | 37 | ``` 38 | npm start 39 | ``` 40 | 41 | 4. LUIS Response 42 | 43 | ``` 44 | Query: turn on the left light 45 | Top Intent: HomeAutomation.TurnOn 46 | Intents: 47 | [ { intent: 'HomeAutomation.TurnOn', score: 0.933549 }, 48 | { intent: 'None', score: 0.09975206 }, 49 | { intent: 'HomeAutomation.TurnOff', score: 0.0276397187 } ] 50 | 51 | ``` -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/python/quickstart-call-endpoint-2-7.py: -------------------------------------------------------------------------------- 1 | ########### Python 2.7 ############# 2 | import httplib, urllib, base64 3 | 4 | headers = { 5 | # Request headers 6 | 'Ocp-Apim-Subscription-Key': 'YOUR-SUBSCRIPTION-KEY', 7 | } 8 | 9 | params = urllib.urlencode({ 10 | # Query parameter 11 | 'q': 'turn on the left light', 12 | # Optional request parameters, set to default values 13 | 'timezoneOffset': '0', 14 | 'verbose': 'false', 15 | 'spellCheck': 'false', 16 | 'staging': 'false', 17 | }) 18 | 19 | try: 20 | conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com') 21 | conn.request("GET", "/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2?%s" % params, "{body}", headers) 22 | response = conn.getresponse() 23 | data = response.read() 24 | print(data) 25 | conn.close() 26 | except Exception as e: 27 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 28 | 29 | #################################### -------------------------------------------------------------------------------- /documentation-samples/archive-endpoint-api-samples/python/quickstart-call-endpoint-3-6.py: -------------------------------------------------------------------------------- 1 | ########### Python 3.6 ############# 2 | import requests 3 | 4 | headers = { 5 | # Request headers 6 | 'Ocp-Apim-Subscription-Key': 'YOUR-SUBSCRIPTION-KEY', 7 | } 8 | 9 | params ={ 10 | # Query parameter 11 | 'q': 'turn on the left light', 12 | # Optional request parameters, set to default values 13 | 'timezoneOffset': '0', 14 | 'verbose': 'false', 15 | 'spellCheck': 'false', 16 | 'staging': 'false', 17 | } 18 | 19 | try: 20 | r = requests.get('https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2',headers=headers, params=params) 21 | print(r.json()) 22 | 23 | except Exception as e: 24 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 25 | 26 | #################################### 27 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/README.md: -------------------------------------------------------------------------------- 1 | ### Change model 2 | 3 | In this quickstart, add example utterances to a Home Automation app and train the app. Example utterances are conversational user text mapped to an intent. By providing example utterances for intents, you teach LUIS what kinds of user-supplied text belongs to which intent. 4 | 5 | For more information, see the technical documentation for the [add example utterance to intent](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c08), [train](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c45), and [training status](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c46) APIs. 6 | 7 | For this article, you need a free [LUIS](http://www.luis.ai) account. 8 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp-core/change-model/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-csharpcore . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-csharpcore luis-authoring-csharpcore 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-csharpcore luis-authoring-csharpcore tail 11 | 12 | FROM mcr.microsoft.com/dotnet/runtime:latest 13 | WORKDIR /app 14 | COPY . /app 15 | 16 | RUN dotnet add package JsonFormatterPlus --version 1.0.2 17 | RUN dotnet add package CommandLineParser --version 2.3.0 18 | RUN ls 19 | 20 | # build 21 | RUN dotnet build 22 | 23 | ENTRYPOINT ["dotnet", "run"] 24 | CMD ["--add", "utterances.json", "--train", "--status"] 25 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp-core/change-model/change-model.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | change_model 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp-core/change-model/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp/ConsoleApp1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{D14C33BE-AF26-43B2-A1D3-7937EC111007}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {37BC7E1D-1D65-4175-B89D-342EC125FC3A} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp/ConsoleApp1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp/ConsoleApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConsoleApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConsoleApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d14c33be-af26-43b2-a1d3-7937ec111007")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp/ConsoleApp1/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/csharp/ConsoleApp1/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/go/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-go . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-go luis-authoring-go 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-running-authoring-go luis-authoring-go tail 11 | 12 | FROM golang:latest 13 | WORKDIR /go/src/LUIS 14 | COPY . . 15 | RUN go get -d -v ./... 16 | RUN go install -v ./... 17 | 18 | RUN go build add-utterances.go 19 | 20 | RUN ls 21 | 22 | ENTRYPOINT ["./add-utterances"] -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/go/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/java/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-java . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-java luis-authoring-java 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-java luis-authoring-java tail 11 | 12 | FROM openjdk:7 13 | COPY . /usr/src/LUIS 14 | 15 | COPY lib/ /lib/ 16 | 17 | WORKDIR /usr/src/LUIS 18 | 19 | RUN ls 20 | 21 | # linux moby syntax 22 | RUN javac -cp ":lib/*" AddUtterances.java 23 | 24 | ENTRYPOINT ["java", "-cp",":lib/*", "AddUtterances"] 25 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/java/lib/gson-2.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/authoring-api-samples/java/lib/gson-2.8.2.jar -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/java/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-node . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-node luis-authoring-node 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-node luis-authoring-node tail 11 | 12 | FROM node:latest 13 | COPY . /usr/src/LUIS 14 | WORKDIR /usr/src/LUIS 15 | RUN npm install 16 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "add-utterances.js", 6 | "scripts": { 7 | "start":"node add-utterances.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "fs-extra": "^5.0.0", 14 | "request": "^2.83.0", 15 | "request-promise": "^4.2.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/node/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/php/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | # BUILD IMAGE 3 | # $ docker build --no-cache -t luis-authoring-php . 4 | # 5 | # RUN CODE 6 | # 7 | # WINDOWS BASH COMMAND 8 | # $ winpty docker run -it --rm --name luis-authoring-php luis-authoring-php 9 | # 10 | # NON-WINDOWS 11 | # $ docker run -it --rm --name luis-running-authoring-php luis-authoring-php tail 12 | 13 | FROM php:7.2-apache 14 | WORKDIR /go/src/LUIS 15 | COPY . . 16 | 17 | ENTRYPOINT ["php","add-utterances.php"] -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/php/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/python/3.x/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-py3 . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-py3 luis-authoring-py3 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-py3 luis-authoring-py3 11 | 12 | FROM python:3 13 | 14 | WORKDIR /usr/src/app 15 | 16 | COPY . . 17 | 18 | CMD [ "python", "./add-utterances-3-6.py" ] -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/python/3.x/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-ruby . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-ruby luis-authoring-ruby 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-ruby luis-authoring-ruby 11 | 12 | FROM ruby:2.5 13 | 14 | WORKDIR /usr/src/app 15 | 16 | COPY . . 17 | 18 | RUN ls 19 | 20 | CMD [ "ruby", "./add-utterances.rb" ] -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/ruby/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/authoring-api-samples/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/README.md: -------------------------------------------------------------------------------- 1 | ### Analyze text 2 | 3 | In this quickstart, use an available public LUIS app to determine a user's intention from conversational text. Send the user's intention as text to the public app's HTTP prediction endpoint. At the endpoint, LUIS applies the public app's model to analyze the natural language text for meaning, determining overall intent and extracting data relevant to the app's subject domain. 4 | 5 | This quickstart uses the endpoint REST API. Refer to the [endpoint API documentation](https://westus.dev.cognitive.microsoft.com/docs/services/5819c76f40a6350ce09de1ac/operations/5819c77140a63516d81aee78) for more information. 6 | 7 | For this article, you need a free [LUIS](http://www.luis.ai) account. 8 | 9 | 10 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/csharp-core/analyze-text/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-csharpcore . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-csharpcore luis-endpoint-csharpcore 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-csharpcore luis-endpoint-csharpcore tail 11 | 12 | FROM mcr.microsoft.com/dotnet/runtime:latest 13 | WORKDIR /app 14 | COPY . /app 15 | 16 | RUN ls 17 | 18 | # build 19 | RUN dotnet build 20 | 21 | ENTRYPOINT ["dotnet", "run"] 22 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/csharp-core/analyze-text/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | 4 | /* 5 | 6 | You can use the authoring key instead of the endpoint key. 7 | The authoring key allows 1000 endpoint queries a month. 8 | 9 | */ 10 | 11 | namespace ConsoleLuisEndpointSample 12 | { 13 | class Program 14 | { 15 | static void Main(string[] args) 16 | { 17 | MakeRequest(); 18 | Console.WriteLine("Hit ENTER to exit..."); 19 | Console.ReadLine(); 20 | } 21 | 22 | static async void MakeRequest() 23 | { 24 | var client = new HttpClient(); 25 | 26 | // This app ID is for a public sample app that recognizes requests to turn on and turn off lights 27 | var luisAppId = "df67dcdb-c37d-46af-88e1-8b97951ca1c2"; 28 | var endpointKey = "YOUR-KEY"; 29 | 30 | // The request header contains your subscription key 31 | client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", endpointKey); 32 | 33 | // The "q" parameter contains the utterance to send to LUIS 34 | var endpointUri = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/" + luisAppId + "?q=" + "turn on the left light"; 35 | var response = await client.GetAsync(endpointUri); 36 | 37 | var strResponseContent = await response.Content.ReadAsStringAsync(); 38 | 39 | // Display the JSON result from LUIS 40 | Console.WriteLine(strResponseContent.ToString()); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/csharp-core/analyze-text/analyze-text.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | analyze_text 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/go/Dockerfile: -------------------------------------------------------------------------------- 1 | # NOTE: replace YOUR-KEY with your endpoint key 2 | # you can use your authoring key if it still has available request quota 3 | # 4 | # BUILD IMAGE 5 | # $ docker build --no-cache -t luis-endpoint-go . 6 | # 7 | # RUN CODE 8 | # 9 | # WINDOWS BASH COMMAND 10 | # $ winpty docker run -it --rm --name luis-running-endpoint-go luis-endpoint-go 11 | # 12 | # NON-WINDOWS 13 | # $ docker run -it --rm --name luis-running-endpoint-go luis-endpoint-go tail 14 | 15 | FROM golang:latest 16 | WORKDIR /go/src/LUIS 17 | COPY . . 18 | RUN go get -d -v ./... 19 | RUN go install -v ./... 20 | 21 | RUN go build endpoint.go 22 | 23 | RUN ls 24 | 25 | ENTRYPOINT ["./endpoint","-endpointKey", "YOUR-KEY", "-region", "westus"] -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/java/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-java . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-java luis-endpoint-java 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-java luis-endpoint-java tail 11 | 12 | FROM openjdk:7 13 | COPY . /usr/src/LUIS 14 | 15 | COPY lib/ /lib/ 16 | 17 | WORKDIR /usr/src/LUIS 18 | 19 | # rename file to LuisGetRequest.java 20 | RUN cp ./call-endpoint.java ./LuisGetRequest.java 21 | RUN ls 22 | #RUN rm /call-endpoint.java 23 | 24 | # linux moby syntax 25 | RUN javac -cp ":lib/*" LuisGetRequest.java 26 | 27 | ENTRYPOINT ["java", "-cp",":lib/*", "LuisGetRequest"] 28 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/java/command-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/endpoint-api-samples/java/command-line.png -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/java/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/endpoint-api-samples/java/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/java/lib/httpclient-4.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/endpoint-api-samples/java/lib/httpclient-4.5.3.jar -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/java/lib/httpcore-4.4.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/endpoint-api-samples/java/lib/httpcore-4.4.6.jar -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/node/.env: -------------------------------------------------------------------------------- 1 | LUIS_APP_ID=df67dcdb-c37d-46af-88e1-8b97951ca1c2 2 | LUIS_ENDPOINT_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-node . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-node luis-endpoint-node 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-node luis-endpoint-node tail 11 | 12 | FROM node:latest 13 | COPY . /usr/src/LUIS 14 | WORKDIR /usr/src/LUIS 15 | RUN npm install 16 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/node/command-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/endpoint-api-samples/node/command-line.png -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "call-endpoint.js", 6 | "scripts": { 7 | "start":"node call-endpoint.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "dotenv": "^4.0.0", 15 | "querystring": "^0.2.0", 16 | "request": "^2.83.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/node/readme.md: -------------------------------------------------------------------------------- 1 | # LUIS Endpoint query with Node.js 2 | 3 | This example calls into the LUIS endpoint of the public IoT LUIS application and returns a query. 4 | 5 | ## Prerequisites 6 | * In .env, change the `LUIS_ENDPOINT_KEY` value to your own LUIS subscription key found under your User account in [LUIS.ai](https://www.luis.ai). 7 | * [Docker](https://www.docker.com/) or [Nodejs](https://nodejs.org) 8 | 9 | ## Run via Docker 10 | You can run this example from a Docker container. 11 | 12 | 1. On the command-line, build the Docker image: 13 | 14 | ``` 15 | docker build --no-cache -t luis-endpoint-node . 16 | ``` 17 | 18 | 2. On the command-line, run the Docker image: 19 | 20 | ``` 21 | docker run -it --rm --name luis-endpoint-node luis-endpoint-node tail 22 | ``` 23 | 24 | ![Example of Docker commands and output](./command-line.png) 25 | 26 | ## Run via Node 27 | You can run this example from Node.js. 28 | 29 | 1. On the command-line, install dependencies: 30 | 31 | ``` 32 | npm install 33 | ``` 34 | 35 | 3. On the command-line, run the file: 36 | 37 | ``` 38 | npm start 39 | ``` 40 | 41 | 4. LUIS Response 42 | 43 | ``` 44 | Query: turn on the left light 45 | Top Intent: HomeAutomation.TurnOn 46 | Intents: 47 | [ { intent: 'HomeAutomation.TurnOn', score: 0.933549 }, 48 | { intent: 'None', score: 0.09975206 }, 49 | { intent: 'HomeAutomation.TurnOff', score: 0.0276397187 } ] 50 | 51 | ``` -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/php/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | # BUILD IMAGE 3 | # $ docker build --no-cache -t luis-endpoint-php . 4 | # 5 | # RUN CODE 6 | # 7 | # WINDOWS BASH COMMAND 8 | # $ winpty docker run -it --rm --name luis-running-endpoint-php luis-endpoint-php 9 | # 10 | # NON-WINDOWS 11 | # $ docker run -it --rm --name luis-running-endpoint-php luis-endpoint-php tail 12 | 13 | FROM php:7.2-apache 14 | WORKDIR /go/src/LUIS 15 | COPY . . 16 | 17 | ENTRYPOINT ["php","endpoint-call.php"] -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/python/2.x/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-py2 . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-py2 luis-endpoint-py2 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-py2 luis-endpoint-py2 11 | 12 | FROM python:2 13 | 14 | WORKDIR /usr/src/app 15 | 16 | RUN pip install requests 17 | 18 | COPY . . 19 | 20 | CMD [ "python", "./quickstart-call-endpoint-2-7.py" ] -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/python/2.x/quickstart-call-endpoint-2-7.py: -------------------------------------------------------------------------------- 1 | ########### Python 2.7 ############# 2 | import httplib, urllib, base64 3 | 4 | headers = { 5 | # Request headers includes endpoint key 6 | # You can use the authoring key instead of the endpoint key. 7 | # The authoring key allows 1000 endpoint queries a month. 8 | 'Ocp-Apim-Subscription-Key': 'YOUR-KEY', 9 | } 10 | 11 | params = urllib.urlencode({ 12 | # Text to analyze 13 | 'q': 'turn on the left light', 14 | # Optional request parameters, set to default values 15 | 'verbose': 'false', 16 | }) 17 | 18 | # HTTP Request 19 | try: 20 | # LUIS endpoint HOST for westus region 21 | conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com') 22 | 23 | # LUIS endpoint path 24 | # includes public app ID 25 | conn.request("GET", "/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2?%s" % params, "{body}", headers) 26 | 27 | response = conn.getresponse() 28 | data = response.read() 29 | 30 | # print HTTP response to screen 31 | print(data) 32 | conn.close() 33 | except Exception as e: 34 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 35 | 36 | #################################### -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/python/3.x/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-py3 . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ docker run -it --rm --name luis-endpoint-py3 luis-endpoint-py3 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-py3 luis-endpoint-py3 11 | 12 | FROM python:3 13 | 14 | WORKDIR /usr/src/app 15 | 16 | RUN pip install requests 17 | 18 | COPY . . 19 | 20 | CMD [ "python", "./quickstart-call-endpoint-3-6.py" ] -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/python/3.x/quickstart-call-endpoint-3-6.py: -------------------------------------------------------------------------------- 1 | ########### Python 3.6 ############# 2 | import requests 3 | 4 | headers = { 5 | # Request headers 6 | 'Ocp-Apim-Subscription-Key': 'YOUR-KEY', 7 | } 8 | 9 | params ={ 10 | # Query parameter 11 | 'q': 'turn on the left light', 12 | # Optional request parameters, set to default values 13 | 'timezoneOffset': '0', 14 | 'verbose': 'false', 15 | 'spellCheck': 'false', 16 | 'staging': 'false', 17 | } 18 | 19 | try: 20 | r = requests.get('https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2',headers=headers, params=params) 21 | print(r.json()) 22 | 23 | except Exception as e: 24 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 25 | 26 | #################################### 27 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/python/quickstart-call-endpoint-2-7.py: -------------------------------------------------------------------------------- 1 | ########### Python 2.7 ############# 2 | import httplib, urllib, base64 3 | 4 | headers = { 5 | # Request headers includes endpoint key 6 | # You can use the authoring key instead of the endpoint key. 7 | # The authoring key allows 1000 endpoint queries a month. 8 | 'Ocp-Apim-Subscription-Key': 'YOUR-KEY', 9 | } 10 | 11 | params = urllib.urlencode({ 12 | # Text to analyze 13 | 'q': 'turn on the left light', 14 | # Optional request parameters, set to default values 15 | 'verbose': 'false', 16 | }) 17 | 18 | # HTTP Request 19 | try: 20 | # LUIS endpoint HOST for westus region 21 | conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com') 22 | 23 | # LUIS endpoint path 24 | # includes public app ID 25 | conn.request("GET", "/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2?%s" % params, "{body}", headers) 26 | 27 | response = conn.getresponse() 28 | data = response.read() 29 | 30 | # print HTTP response to screen 31 | print(data) 32 | conn.close() 33 | except Exception as e: 34 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 35 | 36 | #################################### -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/python/quickstart-call-endpoint-3-6.py: -------------------------------------------------------------------------------- 1 | ########### Python 3.6 ############# 2 | import requests 3 | 4 | headers = { 5 | # Request headers 6 | 'Ocp-Apim-Subscription-Key': 'YOUR-KEY', 7 | } 8 | 9 | params ={ 10 | # Query parameter 11 | 'q': 'turn on the left light', 12 | # Optional request parameters, set to default values 13 | 'timezoneOffset': '0', 14 | 'verbose': 'false', 15 | 'spellCheck': 'false', 16 | 'staging': 'false', 17 | } 18 | 19 | try: 20 | r = requests.get('https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2',headers=headers, params=params) 21 | print(r.json()) 22 | 23 | except Exception as e: 24 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 25 | 26 | #################################### 27 | -------------------------------------------------------------------------------- /documentation-samples/endpoint-api-samples/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-ruby . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-ruby luis-endpoint-ruby 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-ruby luis-endpoint-ruby 11 | 12 | FROM ruby:2.5 13 | 14 | WORKDIR /usr/src/app 15 | 16 | COPY . . 17 | 18 | RUN ls 19 | 20 | CMD [ "ruby", "./endpoint-call.rb" ] -------------------------------------------------------------------------------- /documentation-samples/entity/list/import-example.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "canonicalForm": "Egypt", 4 | "list": [ 5 | "Cairo", 6 | "Alexandria" 7 | ] 8 | }, 9 | { 10 | "canonicalForm": "USA", 11 | "list": [ 12 | "California", 13 | "Texas" 14 | ] 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /documentation-samples/examples-IoT/readme.md: -------------------------------------------------------------------------------- 1 | # IoT application 2 | 3 | This LUIS app provides a starting point for an IoT app for a Home automation system. 4 | 5 | ## Intents 6 | 7 | It has the following intents: 8 | 9 | * HomeAutomation.TurnOff 10 | * HomeAutomation.TurnOn 11 | * None 12 | 13 | ## Entities 14 | 15 | It has the following entities: 16 | 17 | * HomeAutomation.Device 18 | * HomeAutomation.Operation 19 | * HomeAutomation.Room 20 | 21 | ## Labeled utterances 22 | This application has many labeled utterances. 23 | 24 | ## Import 25 | To import the LUIS app, log in to www.luis.ai, go to **My apps**, and click **Import App**. Choose the file `IoT Quickstart with Prebuilt Domain.json` and click **Import**. 26 | -------------------------------------------------------------------------------- /documentation-samples/find-region/csharp/ConsoleAppLUISRegion.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2043 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleAppLUISRegion", "ConsoleAppLUISRegion\ConsoleAppLUISRegion.csproj", "{CBEBBD21-0C3C-4B58-8DA1-A45CE178EDAB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CBEBBD21-0C3C-4B58-8DA1-A45CE178EDAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CBEBBD21-0C3C-4B58-8DA1-A45CE178EDAB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CBEBBD21-0C3C-4B58-8DA1-A45CE178EDAB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CBEBBD21-0C3C-4B58-8DA1-A45CE178EDAB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {060639E6-7A20-4D47-9599-B6708BC69730} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/find-region/csharp/ConsoleAppLUISRegion/ConsoleAppLUISRegion.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /documentation-samples/find-region/csharp/readme.md: -------------------------------------------------------------------------------- 1 | # Get LUIS region from app ID and subscription key 2 | This .Net Core C# Console app demonstrates how, given a LUIS app ID and a LUIS subscription key, return the correct region for the published app. 3 | 4 | Open the solution file in Visual Studio, change the LUIS app ID and LUIS subscription key, then build and run. The console will output the single region associated with this app. The regions that are not included show up in the `Output` window as a 401. 5 | -------------------------------------------------------------------------------- /documentation-samples/find-region/nodejs/index.js: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | Node.js example of finding region when given app ID and subscription key. 3 | -----------------------------------------------------------------------------*/ 4 | 5 | // NPM Dependencies 6 | var request = require('request-promise'); 7 | 8 | // To run this sample, change these constants. 9 | const subscriptionKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; 10 | const appId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; 11 | 12 | const regions = [ 13 | "eastasia", 14 | "southeastasia", 15 | "australiaeast", 16 | "northeurope", 17 | "westeurope", 18 | "eastus", 19 | "eastus2", 20 | "southcentralus", 21 | "westcentralus", 22 | "westus", 23 | "westus2", 24 | "brazilsouth" 25 | ]; 26 | 27 | var searchRegions = async() => { 28 | 29 | for (var i in regions) { 30 | try{ 31 | let response = await request(`https://${regions[i]}.api.cognitive.microsoft.com/luis/v2.0/apps/${appId}?subscription-key=${subscriptionKey}&q=hi`); 32 | return Promise.resolve(regions[i]); 33 | }catch(ex){ 34 | //console.log(ex.options.uri); 35 | } 36 | } 37 | } 38 | 39 | searchRegions().then( (response) => { 40 | console.log(response); 41 | }).catch(err => { 42 | console.log(`Error finding region: ${err.message} `); 43 | }); -------------------------------------------------------------------------------- /documentation-samples/find-region/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "index.js", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "request": "^2.87.0", 15 | "request-promise": "^4.2.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /documentation-samples/find-region/nodejs/readme.md: -------------------------------------------------------------------------------- 1 | # Get LUIS region from app ID and subscription key 2 | This Node.js console app demonstrates how, given a LUIS app ID and a LUIS subscription key, return the correct region for the published app. 3 | 4 | Open the solution file in VS Code, change the LUIS app ID and LUIS subscription key, then build and run. The console will output the single region associated with this app. -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/README.md: -------------------------------------------------------------------------------- 1 | ### Analyze text 2 | 3 | In this quickstart, use an available public LUIS app to determine a user's intention from conversational text. Send the user's intention as text to the public app's HTTP prediction endpoint. At the endpoint, LUIS applies the public app's model to analyze the natural language text for meaning, determining overall intent and extracting data relevant to the app's subject domain. 4 | 5 | This quickstart uses the endpoint REST API. Refer to the [endpoint API documentation](https://westus.dev.cognitive.microsoft.com/docs/services/5819c76f40a6350ce09de1ac/operations/5819c77140a63516d81aee78) for more information. 6 | 7 | For this article, you need a free [LUIS](http://www.luis.ai) account. 8 | 9 | 10 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/csharp-core/analyze-text/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-csharpcore . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-csharpcore luis-endpoint-csharpcore 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-csharpcore luis-endpoint-csharpcore tail 11 | 12 | FROM mcr.microsoft.com/dotnet/runtime:latest 13 | WORKDIR /app 14 | COPY . /app 15 | 16 | RUN ls 17 | 18 | # build 19 | RUN dotnet build 20 | 21 | ENTRYPOINT ["dotnet", "run"] 22 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/csharp-core/analyze-text/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | 4 | /* 5 | 6 | You can use the authoring key instead of the endpoint key. 7 | The authoring key allows 1000 endpoint queries a month. 8 | 9 | */ 10 | 11 | namespace ConsoleLuisEndpointSample 12 | { 13 | class Program 14 | { 15 | static void Main(string[] args) 16 | { 17 | MakeRequest(); 18 | Console.WriteLine("Hit ENTER to exit..."); 19 | Console.ReadLine(); 20 | } 21 | 22 | static async void MakeRequest() 23 | { 24 | var client = new HttpClient(); 25 | 26 | // This app ID is for a public sample app that recognizes requests to turn on and turn off lights 27 | var luisAppId = "df67dcdb-c37d-46af-88e1-8b97951ca1c2"; 28 | var endpointKey = "YOUR-KEY"; 29 | 30 | // The request header contains your subscription key 31 | client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", endpointKey); 32 | 33 | // The "q" parameter contains the utterance to send to LUIS 34 | var endpointUri = "https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/" + luisAppId + "?q=" + "turn on the left light"; 35 | var response = await client.GetAsync(endpointUri); 36 | 37 | var strResponseContent = await response.Content.ReadAsStringAsync(); 38 | 39 | // Display the JSON result from LUIS 40 | Console.WriteLine(strResponseContent.ToString()); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/csharp-core/analyze-text/analyze-text.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | analyze_text 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/go/Dockerfile: -------------------------------------------------------------------------------- 1 | # NOTE: replace YOUR-KEY with your endpoint key 2 | # you can use your authoring key if it still has available request quota 3 | # 4 | # BUILD IMAGE 5 | # $ docker build --no-cache -t luis-endpoint-go . 6 | # 7 | # RUN CODE 8 | # 9 | # WINDOWS BASH COMMAND 10 | # $ winpty docker run -it --rm --name luis-running-endpoint-go luis-endpoint-go 11 | # 12 | # NON-WINDOWS 13 | # $ docker run -it --rm --name luis-running-endpoint-go luis-endpoint-go tail 14 | 15 | FROM golang:latest 16 | WORKDIR /go/src/LUIS 17 | COPY . . 18 | RUN go get -d -v ./... 19 | RUN go install -v ./... 20 | 21 | RUN go build endpoint.go 22 | 23 | RUN ls 24 | 25 | ENTRYPOINT ["./endpoint","-endpointKey", "YOUR-KEY", "-region", "westus"] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/java/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-java . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-java luis-endpoint-java 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-java luis-endpoint-java tail 11 | 12 | FROM openjdk:7 13 | COPY . /usr/src/LUIS 14 | 15 | COPY lib/ /lib/ 16 | 17 | WORKDIR /usr/src/LUIS 18 | 19 | # rename file to LuisGetRequest.java 20 | RUN cp ./call-endpoint.java ./LuisGetRequest.java 21 | RUN ls 22 | #RUN rm /call-endpoint.java 23 | 24 | # linux moby syntax 25 | RUN javac -cp ":lib/*" LuisGetRequest.java 26 | 27 | ENTRYPOINT ["java", "-cp",":lib/*", "LuisGetRequest"] 28 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/java/command-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/quickstarts/analyze-text/java/command-line.png -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/java/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/quickstarts/analyze-text/java/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/java/lib/httpclient-4.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/quickstarts/analyze-text/java/lib/httpclient-4.5.3.jar -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/java/lib/httpcore-4.4.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/quickstarts/analyze-text/java/lib/httpcore-4.4.6.jar -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/node/.env: -------------------------------------------------------------------------------- 1 | LUIS_APP_ID=df67dcdb-c37d-46af-88e1-8b97951ca1c2 2 | LUIS_ENDPOINT_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-node . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-node luis-endpoint-node 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-node luis-endpoint-node tail 11 | 12 | FROM node:latest 13 | COPY . /usr/src/LUIS 14 | WORKDIR /usr/src/LUIS 15 | RUN npm install 16 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/node/command-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/quickstarts/analyze-text/node/command-line.png -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "call-endpoint.js", 6 | "scripts": { 7 | "start":"node call-endpoint.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "dotenv": "^4.0.0", 15 | "querystring": "^0.2.0", 16 | "request": "^2.83.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/node/readme.md: -------------------------------------------------------------------------------- 1 | # LUIS Endpoint query with Node.js 2 | 3 | This example calls into the LUIS endpoint of the public IoT LUIS application and returns a query. 4 | 5 | ## Prerequisites 6 | * In .env, change the `LUIS_ENDPOINT_KEY` value to your own LUIS subscription key found under your User account in [LUIS.ai](https://www.luis.ai). 7 | * [Docker](https://www.docker.com/) or [Nodejs](https://nodejs.org) 8 | 9 | ## Run via Docker 10 | You can run this example from a Docker container. 11 | 12 | 1. On the command-line, build the Docker image: 13 | 14 | ``` 15 | docker build --no-cache -t luis-endpoint-node . 16 | ``` 17 | 18 | 2. On the command-line, run the Docker image: 19 | 20 | ``` 21 | docker run -it --rm --name luis-endpoint-node luis-endpoint-node tail 22 | ``` 23 | 24 | ![Example of Docker commands and output](./command-line.png) 25 | 26 | ## Run via Node 27 | You can run this example from Node.js. 28 | 29 | 1. On the command-line, install dependencies: 30 | 31 | ``` 32 | npm install 33 | ``` 34 | 35 | 3. On the command-line, run the file: 36 | 37 | ``` 38 | npm start 39 | ``` 40 | 41 | 4. LUIS Response 42 | 43 | ``` 44 | Query: turn on the left light 45 | Top Intent: HomeAutomation.TurnOn 46 | Intents: 47 | [ { intent: 'HomeAutomation.TurnOn', score: 0.933549 }, 48 | { intent: 'None', score: 0.09975206 }, 49 | { intent: 'HomeAutomation.TurnOff', score: 0.0276397187 } ] 50 | 51 | ``` -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/php/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | # BUILD IMAGE 3 | # $ docker build --no-cache -t luis-endpoint-php . 4 | # 5 | # RUN CODE 6 | # 7 | # WINDOWS BASH COMMAND 8 | # $ winpty docker run -it --rm --name luis-running-endpoint-php luis-endpoint-php 9 | # 10 | # NON-WINDOWS 11 | # $ docker run -it --rm --name luis-running-endpoint-php luis-endpoint-php tail 12 | 13 | FROM php:7.2-apache 14 | WORKDIR /go/src/LUIS 15 | COPY . . 16 | 17 | ENTRYPOINT ["php","endpoint-call.php"] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/python/2.x/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-py2 . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-py2 luis-endpoint-py2 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-py2 luis-endpoint-py2 11 | 12 | FROM python:2 13 | 14 | WORKDIR /usr/src/app 15 | 16 | RUN pip install requests 17 | 18 | COPY . . 19 | 20 | CMD [ "python", "./quickstart-call-endpoint-2-7.py" ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/python/2.x/quickstart-call-endpoint-2-7.py: -------------------------------------------------------------------------------- 1 | ########### Python 2.7 ############# 2 | import httplib, urllib, base64 3 | 4 | headers = { 5 | # Request headers includes endpoint key 6 | # You can use the authoring key instead of the endpoint key. 7 | # The authoring key allows 1000 endpoint queries a month. 8 | 'Ocp-Apim-Subscription-Key': 'YOUR-KEY', 9 | } 10 | 11 | params = urllib.urlencode({ 12 | # Text to analyze 13 | 'q': 'turn on the left light', 14 | # Optional request parameters, set to default values 15 | 'verbose': 'false', 16 | }) 17 | 18 | # HTTP Request 19 | try: 20 | # LUIS endpoint HOST for westus region 21 | conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com') 22 | 23 | # LUIS endpoint path 24 | # includes public app ID 25 | conn.request("GET", "/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2?%s" % params, "{body}", headers) 26 | 27 | response = conn.getresponse() 28 | data = response.read() 29 | 30 | # print HTTP response to screen 31 | print(data) 32 | conn.close() 33 | except Exception as e: 34 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 35 | 36 | #################################### -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/python/3.x/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-py3 . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ docker run -it --rm --name luis-endpoint-py3 luis-endpoint-py3 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-py3 luis-endpoint-py3 11 | 12 | FROM python:3 13 | 14 | WORKDIR /usr/src/app 15 | 16 | RUN pip install requests 17 | 18 | COPY . . 19 | 20 | CMD [ "python", "./quickstart-call-endpoint-3-6.py" ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/python/3.x/quickstart-call-endpoint-3-6.py: -------------------------------------------------------------------------------- 1 | ########### Python 3.6 ############# 2 | import requests 3 | 4 | headers = { 5 | # Request headers 6 | 'Ocp-Apim-Subscription-Key': 'YOUR-KEY', 7 | } 8 | 9 | params ={ 10 | # Query parameter 11 | 'q': 'turn on the left light', 12 | # Optional request parameters, set to default values 13 | 'timezoneOffset': '0', 14 | 'verbose': 'false', 15 | 'spellCheck': 'false', 16 | 'staging': 'false', 17 | } 18 | 19 | try: 20 | r = requests.get('https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/df67dcdb-c37d-46af-88e1-8b97951ca1c2',headers=headers, params=params) 21 | print(r.json()) 22 | 23 | except Exception as e: 24 | print("[Errno {0}] {1}".format(e.errno, e.strerror)) 25 | 26 | #################################### 27 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/analyze-text/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-endpoint-ruby . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-endpoint-ruby luis-endpoint-ruby 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-endpoint-ruby luis-endpoint-ruby 11 | 12 | FROM ruby:2.5 13 | 14 | WORKDIR /usr/src/app 15 | 16 | COPY . . 17 | 18 | RUN ls 19 | 20 | CMD [ "ruby", "./endpoint-call.rb" ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/README.md: -------------------------------------------------------------------------------- 1 | ### Change model 2 | 3 | In this quickstart, add example utterances to a Home Automation app and train the app. Example utterances are conversational user text mapped to an intent. By providing example utterances for intents, you teach LUIS what kinds of user-supplied text belongs to which intent. 4 | 5 | For more information, see the technical documentation for the [add example utterance to intent](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c08), [train](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c45), and [training status](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c46) APIs. 6 | 7 | For this article, you need a free [LUIS](http://www.luis.ai) account. 8 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp-core/change-model/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-csharpcore . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-csharpcore luis-authoring-csharpcore 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-csharpcore luis-authoring-csharpcore tail 11 | 12 | FROM mcr.microsoft.com/dotnet/runtime:latest 13 | WORKDIR /app 14 | COPY . /app 15 | 16 | RUN dotnet add package JsonFormatterPlus --version 1.0.2 17 | RUN dotnet add package CommandLineParser --version 2.3.0 18 | RUN ls 19 | 20 | # build 21 | RUN dotnet build 22 | 23 | ENTRYPOINT ["dotnet", "run"] 24 | CMD ["--add", "utterances.json", "--train", "--status"] 25 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp-core/change-model/change-model.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | change_model 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp-core/change-model/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp/ConsoleApp1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{D14C33BE-AF26-43B2-A1D3-7937EC111007}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D14C33BE-AF26-43B2-A1D3-7937EC111007}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {37BC7E1D-1D65-4175-B89D-342EC125FC3A} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp/ConsoleApp1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp/ConsoleApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConsoleApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConsoleApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d14c33be-af26-43b2-a1d3-7937ec111007")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp/ConsoleApp1/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp/ConsoleApp1/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/csharp/README.md: -------------------------------------------------------------------------------- 1 | # Travel Agent app 2 | 3 | ## Prerequisites 4 | 5 | 1. Visual Studio 2017 6 | 7 | 1. A free [LUIS](https://www.luis.ai/home) account. 8 | 9 | 1. In your LUIS account dashboard click `Import new app` to import the [TravelAgent.json](https://github.com/Microsoft/LUIS-Samples/blob/master/documentation-samples/quickstarts/change-model/TravelAgent.json) file to create a new app. 10 | 11 | 1. Double-click the solution file to open the project. Dependencies include: System.Web (added as a reference). Inlcude these NuGet packages: JsonFormatterPlus, and CommandLineParser. 12 | 13 | 1. Add the LUIS ID, version, and authoring key to the top of the Program.cs file. These can be found under the `Manage` tab of your Travel Agent app in LUIS. Look under the `Application Information`, `Keys and Endpoints`, and `Versions` menus on the left. 14 | 15 | ## Run the sample 16 | 17 | 1. Run the application in the Windows Command Prompt from the `\bin\Debug` folder of this project.
18 | Execute this: `ConsoleApp1.exe --add utterances.json --train --status` 19 | 20 | 1. The resulting JSON responses will appear in the Command Prompt which show: added utterances and the training status. 21 | 22 | 1. Refer to this quickstart for additional details and JSON interpretation: [Quickstart: Change model using C#](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-get-started-cs-add-utterance) 23 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/go/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-go . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-go luis-authoring-go 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-running-authoring-go luis-authoring-go tail 11 | 12 | FROM golang:latest 13 | WORKDIR /go/src/LUIS 14 | COPY . . 15 | RUN go get -d -v ./... 16 | RUN go install -v ./... 17 | 18 | RUN go build add-utterances.go 19 | 20 | RUN ls 21 | 22 | ENTRYPOINT ["./add-utterances"] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/go/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/java/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-java . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-java luis-authoring-java 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-java luis-authoring-java tail 11 | 12 | FROM openjdk:7 13 | COPY . /usr/src/LUIS 14 | 15 | COPY lib/ /lib/ 16 | 17 | WORKDIR /usr/src/LUIS 18 | 19 | RUN ls 20 | 21 | # linux moby syntax 22 | RUN javac -cp ":lib/*" AddUtterances.java 23 | 24 | ENTRYPOINT ["java", "-cp",":lib/*", "AddUtterances"] 25 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/java/lib/gson-2.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/quickstarts/change-model/java/lib/gson-2.8.2.jar -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/java/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-node . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-node luis-authoring-node 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-node luis-authoring-node tail 11 | 12 | FROM node:latest 13 | COPY . /usr/src/LUIS 14 | WORKDIR /usr/src/LUIS 15 | RUN npm install 16 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "add-utterances.js", 6 | "scripts": { 7 | "start":"node add-utterances.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "fs-extra": "^5.0.0", 14 | "request": "^2.83.0", 15 | "request-promise": "^4.2.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/node/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/php/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | # BUILD IMAGE 3 | # $ docker build --no-cache -t luis-authoring-php . 4 | # 5 | # RUN CODE 6 | # 7 | # WINDOWS BASH COMMAND 8 | # $ winpty docker run -it --rm --name luis-authoring-php luis-authoring-php 9 | # 10 | # NON-WINDOWS 11 | # $ docker run -it --rm --name luis-running-authoring-php luis-authoring-php tail 12 | 13 | FROM php:7.2-apache 14 | WORKDIR /go/src/LUIS 15 | COPY . . 16 | 17 | ENTRYPOINT ["php","add-utterances.php"] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/php/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/python/3.x/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-py3 . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-py3 luis-authoring-py3 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-py3 luis-authoring-py3 11 | 12 | FROM python:3 13 | 14 | WORKDIR /usr/src/app 15 | 16 | COPY . . 17 | 18 | CMD [ "python", "./add-utterances-3-6.py" ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/python/3.x/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t luis-authoring-ruby . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name luis-authoring-ruby luis-authoring-ruby 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name luis-authoring-ruby luis-authoring-ruby 11 | 12 | FROM ruby:2.5 13 | 14 | WORKDIR /usr/src/app 15 | 16 | COPY . . 17 | 18 | RUN ls 19 | 20 | CMD [ "ruby", "./add-utterances.rb" ] -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/ruby/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/quickstarts/change-model/utterances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "go to Seattle today", 4 | "intentName": "BookFlight", 5 | "entityLabels": [ 6 | { 7 | "entityName": "Location::LocationTo", 8 | "startCharIndex": 6, 9 | "endCharIndex": 12 10 | } 11 | ] 12 | }, 13 | { 14 | "text": "a barking dog is annoying", 15 | "intentName": "None", 16 | "entityLabels": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /documentation-samples/readme.md: -------------------------------------------------------------------------------- 1 | These LUIS apps are referenced from the documentation and provide a starting point for training and adding utterances. 2 | 3 | To import a LUIS app, log in to www.luis.ai, go to **My apps**, and click **Import App**. Choose the file JSON file for the app you want to import and click **Import**. 4 | -------------------------------------------------------------------------------- /documentation-samples/sdk-quickstarts/c#/BuildModel/BuildModel.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.271 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildModel", "BuildModel\BuildModel.csproj", "{8D254CA3-581D-4ABA-9B93-BCDAA44EDE45}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8D254CA3-581D-4ABA-9B93-BCDAA44EDE45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {8D254CA3-581D-4ABA-9B93-BCDAA44EDE45}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {8D254CA3-581D-4ABA-9B93-BCDAA44EDE45}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {8D254CA3-581D-4ABA-9B93-BCDAA44EDE45}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {5B859C2D-4E51-4A91-8A39-FC5EAF78EC46} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/sdk-quickstarts/c#/BuildModel/BuildModel/BuildModel.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation-samples/sdk-quickstarts/c#/UsePredictionRuntime/UsePredictionRuntime.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.271 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsePredictionRuntime", "UsePredictionRuntime\UsePredictionRuntime.csproj", "{C3731D41-D993-4B77-92DD-8AE7E7D7C34C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C3731D41-D993-4B77-92DD-8AE7E7D7C34C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {C3731D41-D993-4B77-92DD-8AE7E7D7C34C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {C3731D41-D993-4B77-92DD-8AE7E7D7C34C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {C3731D41-D993-4B77-92DD-8AE7E7D7C34C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C18E085D-6A00-447E-95F2-D41F0F41E5D4} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/sdk-quickstarts/c#/UsePredictionRuntime/UsePredictionRuntime/UsePredictionRuntime.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /documentation-samples/sdk-quickstarts/readme.md: -------------------------------------------------------------------------------- 1 | # SDK examples 2 | 3 | | Quickstart | Programming Language | 4 | |--|--| 5 | | Get runtime prediction| [C#](./c%23/UsePredictionRuntime/)| 6 | | Create app, intent, entity, add example utterance with entity| [C#](./c%23/BuildModel/)| -------------------------------------------------------------------------------- /documentation-samples/tutorial-batch-testing/HumanResources-jobs-batch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "Are there any janitorial jobs currently open?", 4 | "intent": "GetJobInformation", 5 | "entities": [] 6 | }, 7 | { 8 | "text": "I would like a fullstack typescript programming with azure job", 9 | "intent": "GetJobInformation", 10 | "entities": [] 11 | }, 12 | { 13 | "text": "Is there a database position open in Los Colinas?", 14 | "intent": "GetJobInformation", 15 | "entities": [] 16 | }, 17 | { 18 | "text": "Please find database jobs open today in Seattle", 19 | "intent": "GetJobInformation", 20 | "entities": [] 21 | } 22 | ] -------------------------------------------------------------------------------- /documentation-samples/tutorial-list-entity/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tutorial-list-entity", 3 | "version": "1.0.0", 4 | "description": "https://aka.ms/luis-tutorial-list-entity", 5 | "main": "add-entity-list.js", 6 | "scripts": { 7 | "add": "node add-entity-list.js", 8 | "train": "node train.js", 9 | "publish": "node publish.js", 10 | "query": "node query turn up the heat" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "bluebird": "^3.5.1", 16 | "fs-extra": "^5.0.0", 17 | "promise-retry": "^1.1.1", 18 | "request": "^2.83.0", 19 | "request-promise": "^4.2.2", 20 | "sleep-promise": "^2.0.0", 21 | "underscore": "^1.8.3", 22 | "yargs": "^11.0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-speech-intent-recognition/console-output.txt: -------------------------------------------------------------------------------- 1 | Say something... 2 | RECOGNIZED: Text=Who are the approved dentists in Redmond? 3 | Intent Id: GetEmployeeBenefits. 4 | Language Understanding JSON: { 5 | "query": "who are the approved dentists in Redmond", 6 | "topScoringIntent": { 7 | "intent": "GetEmployeeBenefits", 8 | "score": 0.855422735 9 | }, 10 | "entities": [ 11 | { 12 | "entity": "approved dentists", 13 | "type": "builtin.keyPhrase", 14 | "startIndex": 12, 15 | "endIndex": 28 16 | }, 17 | { 18 | "entity": "redmond", 19 | "type": "Location", 20 | "startIndex": 33, 21 | "endIndex": 39, 22 | "score": 0.8524797 23 | } 24 | ] 25 | }. -------------------------------------------------------------------------------- /documentation-samples/tutorial-speech-intent-recognition/csharp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-speech-intent-recognition/csharp/csharp_samples.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2015 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "csharp_samples", "csharp_samples.csproj", "{044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Debug|x64.ActiveCfg = Debug|x64 17 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Debug|x64.Build.0 = Debug|x64 18 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Debug|x86.ActiveCfg = Debug|x86 19 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Debug|x86.Build.0 = Debug|x86 20 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Release|x64.ActiveCfg = Release|x64 21 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Release|x64.Build.0 = Release|x64 22 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Release|x86.ActiveCfg = Release|x86 23 | {044EFA3A-3FDB-419D-8AFC-4B6D8BB5367D}.Release|x86.Build.0 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {396A9DDC-A8C5-4003-9384-45860A740D7C} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-speech-intent-recognition/csharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-speech-intent-recognition/readme.md: -------------------------------------------------------------------------------- 1 | # Speech to intent 2 | Read more about speech to intent from the [tutorial](https://aka.ms/luis-intent-recognition-tutorial). 3 | 4 | Before using this code, import the [Human Resources app](csharp/HumanResources.json). This has intents, entities, and example utterances. 5 | 6 | Do not use the free starter key. 7 | 8 | If you are interested in more information about the Speech services, read through the [documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/) and download the [SDK](https://github.com/Azure-Samples/cognitive-services-speech-sdk). -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/.deployment: -------------------------------------------------------------------------------- 1 | [config] 2 | command = deploy.cmd -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/.gitignore: -------------------------------------------------------------------------------- 1 | *.dll 2 | *.pdb 3 | obj/** 4 | bin/** 5 | runtimes/** 6 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/BookingDetails.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.BotBuilderSamples 5 | { 6 | public class BookingDetails 7 | { 8 | public string Destination { get; set; } 9 | 10 | public string Origin { get; set; } 11 | 12 | public string TravelDate { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/ConfigurationCredentialProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.Bot.Connector.Authentication; 5 | using Microsoft.Extensions.Configuration; 6 | 7 | namespace Microsoft.BotBuilderSamples 8 | { 9 | public class ConfigurationCredentialProvider : SimpleCredentialProvider 10 | { 11 | public ConfigurationCredentialProvider(IConfiguration configuration) 12 | : base(configuration["MicrosoftAppId"], configuration["MicrosoftAppPassword"]) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/Controllers/BotController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Bot.Builder; 7 | using Microsoft.Bot.Builder.Integration.AspNet.Core; 8 | 9 | namespace Microsoft.BotBuilderSamples.Controllers 10 | { 11 | // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot 12 | // implementation at runtime. Multiple different IBot implementations running at different endpoints can be 13 | // achieved by specifying a more specific type for the bot constructor argument. 14 | [Route("api/messages")] 15 | [ApiController] 16 | public class BotController : ControllerBase 17 | { 18 | private readonly IBotFrameworkHttpAdapter Adapter; 19 | private readonly IBot Bot; 20 | 21 | public BotController(IBotFrameworkHttpAdapter adapter, IBot bot) 22 | { 23 | Adapter = adapter; 24 | Bot = bot; 25 | } 26 | 27 | [HttpPost] 28 | public async Task PostAsync() 29 | { 30 | // Delegate the processing of the HTTP POST to the adapter. 31 | // The adapter will invoke the bot. 32 | await Adapter.ProcessAsync(Request, Response, Bot); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/CoreBot.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/CoreBot.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.1", 4 | "framework": { 5 | "name": "Microsoft.AspNetCore.App", 6 | "version": "2.1.1" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/CoreBot.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.168 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreBot", "CoreBot.csproj", "{0793F52D-82C5-4C6E-967B-606676CF8B17}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {6048CA87-FB18-4F6E-BD46-2D59A57DD456} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/DialogExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using Microsoft.Bot.Builder; 7 | using Microsoft.Bot.Builder.Dialogs; 8 | 9 | namespace Microsoft.BotBuilderSamples 10 | { 11 | public static class DialogExtensions 12 | { 13 | public static async Task Run(this Dialog dialog, ITurnContext turnContext, IStatePropertyAccessor accessor, CancellationToken cancellationToken = default(CancellationToken)) 14 | { 15 | var dialogSet = new DialogSet(accessor); 16 | dialogSet.Add(dialog); 17 | 18 | var dialogContext = await dialogSet.CreateContextAsync(turnContext, cancellationToken); 19 | var results = await dialogContext.ContinueDialogAsync(cancellationToken); 20 | if (results.Status == DialogTurnStatus.Empty) 21 | { 22 | await dialogContext.BeginDialogAsync(dialog.Id, null, cancellationToken); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/PostDeployScripts/IncludeSources.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Always 5 | 6 | 7 | Always 8 | 9 | 10 | Always 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/PostDeployScripts/githubProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "homepage": "https://github.com", 5 | "private": false, 6 | "has_issues": true, 7 | "has_projects": true, 8 | "has_wiki": true 9 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/PostDeployScripts/publish.cmd.template: -------------------------------------------------------------------------------- 1 | nuget restore 2 | msbuild {SOLUTION_NAME} -p:DeployOnBuild=true -p:PublishProfile={PUBLISH_PROFILE} -p:Password={PASSWORD} 3 | 4 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/PostDeployScripts/publishProfile.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | MSDeploy 9 | AzureWebSite 10 | Release 11 | Any CPU 12 | http://{WEB_SITE_NAME}.azurewebsites.net 13 | True 14 | False 15 | {WEB_SITE_NAME}.scm.azurewebsites.net:443 16 | {WEB_SITE_NAME} 17 | 18 | True 19 | WMSVC 20 | True 21 | ${WEB_SITE_NAME} 22 | <_SavePWD>True 23 | <_DestinationType>AzureWebSite 24 | 25 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/PostDeployScripts/publishSettings.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/PostDeployScripts/runGulp.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | set DEPLOYMENT_SOURCE= 5 | set IN_PLACE_DEPLOYMENT=1 6 | 7 | if exist ..\wwwroot\deploy.cmd ( 8 | pushd ..\wwwroot 9 | call deploy.cmd 10 | popd 11 | ) 12 | 13 | rem kick of build of csproj 14 | 15 | echo record deployment timestamp 16 | date /t >> ..\deployment.log 17 | time /t >> ..\deployment.log 18 | echo ---------------------- >> ..\deployment.log 19 | echo Deployment done 20 | 21 | endlocal 22 | 23 | 24 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/PostDeployScripts/vsoProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "capabilities": { 5 | "versioncontrol": { 6 | "sourceControlType": "Git" 7 | }, 8 | "processTemplate": { 9 | "templateTypeId": "6b724908-ef14-45cf-84f8-768b5384da45" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.AspNetCore; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace Microsoft.BotBuilderSamples 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | CreateWebHostBuilder(args).Build().Run(); 15 | } 16 | 17 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 18 | WebHost.CreateDefaultBuilder(args) 19 | .ConfigureLogging((logging) => 20 | { 21 | logging.AddDebug(); 22 | logging.AddConsole(); 23 | }) 24 | .UseStartup(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | set DEPLOYMENT_SOURCE= 5 | set DEPLOYMENT_TARGET=%~dp0%. 6 | 7 | copy %~dp0wwwroot\default.htm %~dp0app_offline.htm 8 | 9 | if exist ..\wwwroot\deploy.cmd ( 10 | pushd ..\wwwroot 11 | call deploy.cmd 12 | popd 13 | ) 14 | 15 | del %~dp0%\app_offline.htm 16 | 17 | endlocal 18 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/publish.cmd: -------------------------------------------------------------------------------- 1 | nuget restore 2 | msbuild CoreBot.sln -p:DeployOnBuild=true -p:PublishProfile=luis-csharp-bot-johnsmith-Web-Deploy.pubxml -p:Password=bSJFJvThkqEy0L5QFropuvraRFxf5aE4HsmlMxbvEkr3JMxuQz4frnu5cDwM 3 | 4 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-csharp-bot-johnsmith-src-telemetry/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/.deployment: -------------------------------------------------------------------------------- 1 | [config] 2 | command = deploy.cmd -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/.env: -------------------------------------------------------------------------------- 1 | LuisAPIHostName=.api.cognitive.microsoft.com 2 | LuisAPIKey= 3 | LuisAppId= 4 | MicrosoftAppId= 5 | MicrosoftAppPassword= 6 | MicrosoftApplicationInsightsInstrumentationKey= 7 | ScmType=None -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "rules": { 4 | "semi": [2, "always"], 5 | "indent": [2, 4], 6 | "no-return-await": 0, 7 | "space-before-function-paren": [2, { 8 | "named": "never", 9 | "anonymous": "never", 10 | "asyncArrow": "always" 11 | }], 12 | "template-curly-spacing": [2, "always"] 13 | } 14 | }; -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | *.js.map 3 | .env 4 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${workspaceFolder}\\index.js" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/PostDeployScripts/githubProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "homepage": "https://github.com", 5 | "private": false, 6 | "has_issues": true, 7 | "has_projects": true, 8 | "has_wiki": true 9 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/PostDeployScripts/runGulp.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | 5 | echo record deployment timestamp 6 | date /t >> ..\deployment.log 7 | time /t >> ..\deployment.log 8 | echo ---------------------- >> ..\deployment.log 9 | echo Deployment done 10 | 11 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/PostDeployScripts/vsoProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "capabilities": { 5 | "versioncontrol": { 6 | "sourceControlType": "Git" 7 | }, 8 | "processTemplate": { 9 | "templateTypeId": "6b724908-ef14-45cf-84f8-768b5384da45" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/appInsightsLog.js: -------------------------------------------------------------------------------- 1 | const appInsights = require('applicationinsights'); 2 | const _ = require("underscore"); 3 | 4 | 5 | // Log LUIS results to Application Insights 6 | // must flatten as name/value pairs 7 | var appInsightsLog = (botContext,luisResponse) => { 8 | 9 | appInsights.setup(process.env.MicrosoftApplicationInsightsInstrumentationKey).start(); 10 | const appInsightsClient = appInsights.defaultClient; 11 | 12 | // put bot context and LUIS results into single object 13 | var data = Object.assign({}, {'botContext': botContext._activity}, {'luisResponse': luisResponse}); 14 | 15 | // Flatten data into name/value pairs 16 | flatten = (x, result, prefix) => { 17 | if(_.isObject(x)) { 18 | _.each(x, (v, k) => { 19 | flatten(v, result, prefix ? prefix + '_' + k : k) 20 | }) 21 | } else { 22 | result["LUIS_" + prefix] = x 23 | } 24 | return result; 25 | } 26 | 27 | // call fn to flatten data 28 | var flattenedData = flatten(data, {}); 29 | 30 | // ApplicationInsights Trace 31 | console.log(JSON.stringify(flattenedData)); 32 | 33 | // send data to Application Insights 34 | appInsightsClient.trackTrace({message: "LUIS", severity: appInsights.Contracts.SeverityLevel.Information, properties: flattenedData}); 35 | } 36 | 37 | module.exports.appInsightsLog = appInsightsLog; -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/bots/dialogAndWelcomeBot.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | const { CardFactory } = require('botbuilder-core'); 5 | const { DialogBot } = require('./dialogBot'); 6 | const WelcomeCard = require('./resources/welcomeCard.json'); 7 | 8 | class DialogAndWelcomeBot extends DialogBot { 9 | constructor(conversationState, userState, dialog, logger) { 10 | super(conversationState, userState, dialog, logger); 11 | 12 | this.onMembersAdded(async (context, next) => { 13 | const membersAdded = context.activity.membersAdded; 14 | for (let cnt = 0; cnt < membersAdded.length; cnt++) { 15 | if (membersAdded[cnt].id !== context.activity.recipient.id) { 16 | const welcomeCard = CardFactory.adaptiveCard(WelcomeCard); 17 | await context.sendActivity({ attachments: [welcomeCard] }); 18 | } 19 | } 20 | 21 | // By calling next() you ensure that the next BotHandler is run. 22 | await next(); 23 | }); 24 | } 25 | } 26 | 27 | module.exports.DialogAndWelcomeBot = DialogAndWelcomeBot; 28 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/iisnode.yml: -------------------------------------------------------------------------------- 1 | nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\10.14.1\node.exe" -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-bot", 3 | "version": "1.0.0", 4 | "description": "A bot that demonstrates core AI capabilities", 5 | "author": "Microsoft", 6 | "license": "MIT", 7 | "main": "index.js", 8 | "scripts": { 9 | "start": "node ./index.js", 10 | "watch": "nodemon ./index.js", 11 | "lint": "eslint .", 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/Microsoft/BotBuilder-Samples.git" 17 | }, 18 | "dependencies": { 19 | "@microsoft/recognizers-text-data-types-timex-expression": "^1.1.4", 20 | "applicationinsights": "^1.4.0", 21 | "botbuilder": "^4.4.0", 22 | "botbuilder-ai": "^4.4.0", 23 | "botbuilder-dialogs": "^4.4.0", 24 | "dotenv": "^6.1.0", 25 | "restify": "^7.2.3", 26 | "underscore": "^1.9.1" 27 | }, 28 | "devDependencies": { 29 | "eslint": "^5.9.0", 30 | "eslint-config-standard": "^12.0.0", 31 | "eslint-plugin-import": "^2.14.0", 32 | "eslint-plugin-node": "^8.0.0", 33 | "eslint-plugin-promise": "^4.0.1", 34 | "eslint-plugin-standard": "^4.0.0", 35 | "nodemon": "^1.18.6" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/publish.cmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/tutorial-web-app-bot-application-insights/v4/luis-nodejs-bot-johnsmith-src-telemetry/publish.cmd -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/readme.md: -------------------------------------------------------------------------------- 1 | # Web app bot using Language Understanding 2 | 3 | |Language| 4 | |--| 5 | |[C#](./v4/luis-csharp-bot-johnsmith-src/readme.md)| 6 | |[Node.js](./v4/luis-nodejs-bot-johnsmith-src/readme.md) 7 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/.deployment: -------------------------------------------------------------------------------- 1 | [config] 2 | command = deploy.cmd -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/.gitignore: -------------------------------------------------------------------------------- 1 | *.dll 2 | *.pdb 3 | obj/** 4 | bin/** 5 | runtimes/** 6 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/BookingDetails.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.BotBuilderSamples 5 | { 6 | public class BookingDetails 7 | { 8 | public string Destination { get; set; } 9 | 10 | public string Origin { get; set; } 11 | 12 | public string TravelDate { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/ConfigurationCredentialProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.Bot.Connector.Authentication; 5 | using Microsoft.Extensions.Configuration; 6 | 7 | namespace Microsoft.BotBuilderSamples 8 | { 9 | public class ConfigurationCredentialProvider : SimpleCredentialProvider 10 | { 11 | public ConfigurationCredentialProvider(IConfiguration configuration) 12 | : base(configuration["MicrosoftAppId"], configuration["MicrosoftAppPassword"]) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/Controllers/BotController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Bot.Builder; 7 | using Microsoft.Bot.Builder.Integration.AspNet.Core; 8 | 9 | namespace Microsoft.BotBuilderSamples.Controllers 10 | { 11 | // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot 12 | // implementation at runtime. Multiple different IBot implementations running at different endpoints can be 13 | // achieved by specifying a more specific type for the bot constructor argument. 14 | [Route("api/messages")] 15 | [ApiController] 16 | public class BotController : ControllerBase 17 | { 18 | private readonly IBotFrameworkHttpAdapter Adapter; 19 | private readonly IBot Bot; 20 | 21 | public BotController(IBotFrameworkHttpAdapter adapter, IBot bot) 22 | { 23 | Adapter = adapter; 24 | Bot = bot; 25 | } 26 | 27 | [HttpPost] 28 | public async Task PostAsync() 29 | { 30 | // Delegate the processing of the HTTP POST to the adapter. 31 | // The adapter will invoke the bot. 32 | await Adapter.ProcessAsync(Request, Response, Bot); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/CoreBot.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/CoreBot.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.1", 4 | "framework": { 5 | "name": "Microsoft.AspNetCore.App", 6 | "version": "2.1.1" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/CoreBot.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.168 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreBot", "CoreBot.csproj", "{0793F52D-82C5-4C6E-967B-606676CF8B17}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0793F52D-82C5-4C6E-967B-606676CF8B17}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {6048CA87-FB18-4F6E-BD46-2D59A57DD456} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/DialogExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using Microsoft.Bot.Builder; 7 | using Microsoft.Bot.Builder.Dialogs; 8 | 9 | namespace Microsoft.BotBuilderSamples 10 | { 11 | public static class DialogExtensions 12 | { 13 | public static async Task Run(this Dialog dialog, ITurnContext turnContext, IStatePropertyAccessor accessor, CancellationToken cancellationToken = default(CancellationToken)) 14 | { 15 | var dialogSet = new DialogSet(accessor); 16 | dialogSet.Add(dialog); 17 | 18 | var dialogContext = await dialogSet.CreateContextAsync(turnContext, cancellationToken); 19 | var results = await dialogContext.ContinueDialogAsync(cancellationToken); 20 | if (results.Status == DialogTurnStatus.Empty) 21 | { 22 | await dialogContext.BeginDialogAsync(dialog.Id, null, cancellationToken); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/PostDeployScripts/IncludeSources.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Always 5 | 6 | 7 | Always 8 | 9 | 10 | Always 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/PostDeployScripts/githubProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "homepage": "https://github.com", 5 | "private": false, 6 | "has_issues": true, 7 | "has_projects": true, 8 | "has_wiki": true 9 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/PostDeployScripts/publish.cmd.template: -------------------------------------------------------------------------------- 1 | nuget restore 2 | msbuild {SOLUTION_NAME} -p:DeployOnBuild=true -p:PublishProfile={PUBLISH_PROFILE} -p:Password={PASSWORD} 3 | 4 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/PostDeployScripts/publishProfile.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | MSDeploy 9 | AzureWebSite 10 | Release 11 | Any CPU 12 | http://{WEB_SITE_NAME}.azurewebsites.net 13 | True 14 | False 15 | {WEB_SITE_NAME}.scm.azurewebsites.net:443 16 | {WEB_SITE_NAME} 17 | 18 | True 19 | WMSVC 20 | True 21 | ${WEB_SITE_NAME} 22 | <_SavePWD>True 23 | <_DestinationType>AzureWebSite 24 | 25 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/PostDeployScripts/publishSettings.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/PostDeployScripts/runGulp.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | set DEPLOYMENT_SOURCE= 5 | set IN_PLACE_DEPLOYMENT=1 6 | 7 | if exist ..\wwwroot\deploy.cmd ( 8 | pushd ..\wwwroot 9 | call deploy.cmd 10 | popd 11 | ) 12 | 13 | rem kick of build of csproj 14 | 15 | echo record deployment timestamp 16 | date /t >> ..\deployment.log 17 | time /t >> ..\deployment.log 18 | echo ---------------------- >> ..\deployment.log 19 | echo Deployment done 20 | 21 | endlocal 22 | 23 | 24 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/PostDeployScripts/vsoProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "capabilities": { 5 | "versioncontrol": { 6 | "sourceControlType": "Git" 7 | }, 8 | "processTemplate": { 9 | "templateTypeId": "6b724908-ef14-45cf-84f8-768b5384da45" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.AspNetCore; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace Microsoft.BotBuilderSamples 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | CreateWebHostBuilder(args).Build().Run(); 15 | } 16 | 17 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 18 | WebHost.CreateDefaultBuilder(args) 19 | .ConfigureLogging((logging) => 20 | { 21 | logging.AddDebug(); 22 | logging.AddConsole(); 23 | }) 24 | .UseStartup(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuisAPIHostName": ".api.cognitive.microsoft.com", 3 | "LuisAPIKey": "", 4 | "LuisAppId": "", 5 | "MicrosoftAppId": "", 6 | "MicrosoftAppPassword": "", 7 | "ScmType": "None", 8 | "BotDevAppInsightsKey": "" 9 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | set DEPLOYMENT_SOURCE= 5 | set DEPLOYMENT_TARGET=%~dp0%. 6 | 7 | copy %~dp0wwwroot\default.htm %~dp0app_offline.htm 8 | 9 | if exist ..\wwwroot\deploy.cmd ( 10 | pushd ..\wwwroot 11 | call deploy.cmd 12 | popd 13 | ) 14 | 15 | del %~dp0%\app_offline.htm 16 | 17 | endlocal 18 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/publish.cmd: -------------------------------------------------------------------------------- 1 | nuget restore 2 | msbuild CoreBot.sln -p:DeployOnBuild=true -p:PublishProfile=luis-csharp-bot-johnsmith-Web-Deploy.pubxml -p:Password=bSJFJvThkqEy0L5QFropuvraRFxf5aE4HsmlMxbvEkr3JMxuQz4frnu5cDwM 3 | 4 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-csharp-bot-johnsmith-src/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/.deployment: -------------------------------------------------------------------------------- 1 | [config] 2 | command = deploy.cmd -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "rules": { 4 | "semi": [2, "always"], 5 | "indent": [2, 4], 6 | "no-return-await": 0, 7 | "space-before-function-paren": [2, { 8 | "named": "never", 9 | "anonymous": "never", 10 | "asyncArrow": "always" 11 | }], 12 | "template-curly-spacing": [2, "always"] 13 | } 14 | }; -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | *.js.map 3 | .env 4 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/PostDeployScripts/githubProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "homepage": "https://github.com", 5 | "private": false, 6 | "has_issues": true, 7 | "has_projects": true, 8 | "has_wiki": true 9 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/PostDeployScripts/publish.js.template: -------------------------------------------------------------------------------- 1 | var zipFolder = require('zip-folder'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var request = require('request'); 5 | 6 | var rootFolder = path.resolve('.'); 7 | var zipPath = path.resolve(rootFolder, '../{WEB_SITE_NAME}.zip'); 8 | var kuduApi = 'https://{WEB_SITE_NAME}.scm.azurewebsites.net/api/zip/site/wwwroot'; 9 | var userName = '${WEB_SITE_NAME}'; 10 | var password = '{PASSWORD}'; 11 | 12 | function uploadZip(callback) { 13 | fs.createReadStream(zipPath).pipe(request.put(kuduApi, { 14 | auth: { 15 | username: userName, 16 | password: password, 17 | sendImmediately: true 18 | }, 19 | headers: { 20 | "Content-Type": "applicaton/zip" 21 | } 22 | })) 23 | .on('response', function(resp){ 24 | if (resp.statusCode >= 200 && resp.statusCode < 300) { 25 | fs.unlink(zipPath); 26 | callback(null); 27 | } else if (resp.statusCode >= 400) { 28 | callback(resp); 29 | } 30 | }) 31 | .on('error', function(err) { 32 | callback(err) 33 | }); 34 | } 35 | 36 | function publish(callback) { 37 | zipFolder(rootFolder, zipPath, function(err) { 38 | if (!err) { 39 | uploadZip(callback); 40 | } else { 41 | callback(err); 42 | } 43 | }) 44 | } 45 | 46 | publish(function(err) { 47 | if (!err) { 48 | console.log('{WEB_SITE_NAME} publish'); 49 | } else { 50 | console.error('failed to publish {WEB_SITE_NAME}', err); 51 | } 52 | }); -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/PostDeployScripts/runGulp.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | 5 | echo record deployment timestamp 6 | date /t >> ..\deployment.log 7 | time /t >> ..\deployment.log 8 | echo ---------------------- >> ..\deployment.log 9 | echo Deployment done 10 | 11 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/PostDeployScripts/vsoProject.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{WEB_SITE_NAME}", 3 | "description": "{WEB_SITE_NAME} Azure Bot Service Code", 4 | "capabilities": { 5 | "versioncontrol": { 6 | "sourceControlType": "Git" 7 | }, 8 | "processTemplate": { 9 | "templateTypeId": "6b724908-ef14-45cf-84f8-768b5384da45" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/bots/dialogAndWelcomeBot.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | const { CardFactory } = require('botbuilder-core'); 5 | const { DialogBot } = require('./dialogBot'); 6 | const WelcomeCard = require('./resources/welcomeCard.json'); 7 | 8 | class DialogAndWelcomeBot extends DialogBot { 9 | constructor(conversationState, userState, dialog, logger) { 10 | super(conversationState, userState, dialog, logger); 11 | 12 | this.onMembersAdded(async (context, next) => { 13 | const membersAdded = context.activity.membersAdded; 14 | for (let cnt = 0; cnt < membersAdded.length; cnt++) { 15 | if (membersAdded[cnt].id !== context.activity.recipient.id) { 16 | const welcomeCard = CardFactory.adaptiveCard(WelcomeCard); 17 | await context.sendActivity({ attachments: [welcomeCard] }); 18 | } 19 | } 20 | 21 | // By calling next() you ensure that the next BotHandler is run. 22 | await next(); 23 | }); 24 | } 25 | } 26 | 27 | module.exports.DialogAndWelcomeBot = DialogAndWelcomeBot; 28 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/iisnode.yml: -------------------------------------------------------------------------------- 1 | nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\10.14.1\node.exe" -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-bot", 3 | "version": "1.0.0", 4 | "description": "A bot that demonstrates core AI capabilities", 5 | "author": "Microsoft", 6 | "license": "MIT", 7 | "main": "index.js", 8 | "scripts": { 9 | "start": "node ./index.js", 10 | "watch": "nodemon ./index.js", 11 | "lint": "eslint .", 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/Microsoft/BotBuilder-Samples.git" 17 | }, 18 | "dependencies": { 19 | "@microsoft/recognizers-text-data-types-timex-expression": "^1.1.4", 20 | "botbuilder": "^4.4.0", 21 | "botbuilder-ai": "^4.4.0", 22 | "botbuilder-dialogs": "^4.4.0", 23 | "dotenv": "^6.1.0", 24 | "restify": "^7.2.3" 25 | }, 26 | "devDependencies": { 27 | "eslint": "^5.9.0", 28 | "eslint-config-standard": "^12.0.0", 29 | "eslint-plugin-import": "^2.14.0", 30 | "eslint-plugin-node": "^8.0.0", 31 | "eslint-plugin-promise": "^4.0.1", 32 | "eslint-plugin-standard": "^4.0.0", 33 | "nodemon": "^1.18.6" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/publish.cmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/publish.cmd -------------------------------------------------------------------------------- /documentation-samples/tutorials/HumanResources-jobs-batch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "Are there any janitorial jobs currently open?", 4 | "intent": "GetJobInformation", 5 | "entities": [] 6 | }, 7 | { 8 | "text": "I would like a fullstack typescript programming with azure job", 9 | "intent": "GetJobInformation", 10 | "entities": [] 11 | }, 12 | { 13 | "text": "Is there a database position open in Los Colinas?", 14 | "intent": "GetJobInformation", 15 | "entities": [] 16 | }, 17 | { 18 | "text": "Please find database jobs open today in Seattle", 19 | "intent": "GetJobInformation", 20 | "entities": [] 21 | } 22 | ] -------------------------------------------------------------------------------- /documentation-samples/tutorials/machine-learned-entity/pizza-intents-only.lu: -------------------------------------------------------------------------------- 1 | 2 | > LUIS application information 3 | > !# @app.name = Pizza tutorial intents only 4 | > !# @app.versionId = 0.1 5 | > !# @app.culture = en-us 6 | > !# @app.luis_schema_version = 6.0.0 7 | 8 | 9 | > # Intent definitions 10 | 11 | ## Confirm 12 | - go ahead 13 | - ok 14 | - sure 15 | - yes 16 | 17 | 18 | @ intent Confirm 19 | 20 | ## Greeting 21 | - begin 22 | - hello 23 | - hey 24 | - hi 25 | - start 26 | 27 | 28 | @ intent Greeting 29 | 30 | ## None 31 | - barking dogs are annoying 32 | - order a pizza for me 33 | - penguins in the ocean 34 | 35 | 36 | @ intent None 37 | 38 | ## OrderPizza 39 | - can i get a pepperoni pizza and a can of coke please 40 | - can i get a small pizza with onions peppers and olives 41 | - delivery for a small pepperoni pizza 42 | - i need 2 large cheese pizzas 6 large pepperoni pizzas and 1 large supreme pizza 43 | - pickup a cheddar cheese pizza large with extra anchovies 44 | 45 | 46 | @ intent OrderPizza 47 | 48 | > # Entity definitions 49 | 50 | 51 | > # PREBUILT Entity definitions 52 | 53 | 54 | > # Phrase list definitions 55 | 56 | 57 | > # List entities 58 | 59 | > # RegEx entities 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # LUIS Samples - Examples 2 | 3 | These samples provide LUIS apps to demonstrate scenarios. You can import the LUIS app in [luis.ai][LUIS] to learn about features of LUIS. 4 | 5 | ## Examples 6 | 7 | * [Phrase List Example][PhraseList]: The phrase list example demonstrates how to use a simple [phrase list feature][PhraseListDoc] to improve a LUIS app's performance. 8 | 9 | [PhraseList]: ./phrase_list/README.md 10 | [PhraseListDoc]: https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/add-features#phrase-list-features 11 | [LUIS]: https://www.luis.ai 12 | 13 | * [Batch Upload Examples][BatchUpload]: The batch upload examples demonstrate how to load example utterances into your LUIS application. 14 | 15 | [BatchUpload]: ./demo-upload-example-utterances/README.md 16 | [BatchUploadDoc]: https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c09 17 | [LUIS]: https://www.luis.ai 18 | -------------------------------------------------------------------------------- /examples/async-query-log/nodejs/README.md: -------------------------------------------------------------------------------- 1 | # Get query log asynchronously 2 | 3 | ## Full cycle of request download, wait for download, save file to disk 4 | 5 | ``` 6 | node getQueryLog.js --appid 123 --authkey 123 7 | ``` 8 | 9 | ## Full cycle with named file and region 10 | 11 | ``` 12 | node getQueryLog.js --file 123.csv --appid 123 --authkey 456 --region westus 13 | ``` 14 | 15 | ## Begin download process on server with region 16 | 17 | ``` 18 | node getQueryLog.js --appid 123 --authkey 456 --region westus --step begin 19 | ``` 20 | 21 | ## Request status with region 22 | 23 | ``` 24 | node getQueryLog.js --appid 123 --authkey 456 --region westus --step status 25 | ``` 26 | 27 | ## Request download file with region 28 | 29 | ``` 30 | node getQueryLog.js --appid 123 --authkey 456 --region westus --step final 31 | ``` -------------------------------------------------------------------------------- /examples/async-query-log/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example_get_querylog", 3 | "version": "1.0.0", 4 | "description": "Use the Microsoft LUIS Authoring API to get query log async.", 5 | "main": "queryLogAsync.js", 6 | "scripts": { 7 | "start": "node queryLogAsync.js" 8 | }, 9 | "license": "ISC", 10 | "dependencies": { 11 | "co": "^4.6.0", 12 | "request": "^2.83.0", 13 | "requestretry": "^1.13.0", 14 | "yargs": "^11.0.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "disabled": false, 3 | "bindings": [ 4 | { 5 | "authLevel": "function", 6 | "name": "req", 7 | "type": "httpTrigger", 8 | "direction": "in" 9 | }, 10 | { 11 | "name": "$return", 12 | "type": "http", 13 | "direction": "out" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/media/appInsights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/azure-function-application-insights-endpoint/media/appInsights.png -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/media/dependency-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/azure-function-application-insights-endpoint/media/dependency-details.png -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/media/portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/azure-function-application-insights-endpoint/media/portal.png -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/media/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/azure-function-application-insights-endpoint/media/search.png -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "frameworks": { 3 | "net46":{ 4 | "dependencies": { 5 | "Microsoft.ApplicationInsights": "2.4.0", 6 | "Newtonsoft.Json": "10.0.3" 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/results.json: -------------------------------------------------------------------------------- 1 | { 2 | "query": "turn on the hall lightz", 3 | "alteredQuery": "turn on the hall lights", 4 | "topScoringIntent": { 5 | "intent": "HomeAutomation.TurnOn", 6 | "score": 0.967249 7 | }, 8 | "intents": [ 9 | { 10 | "intent": "HomeAutomation.TurnOn", 11 | "score": 0.967249 12 | }, 13 | { 14 | "intent": "None", 15 | "score": 0.103485465 16 | }, 17 | { 18 | "intent": "HomeAutomation.TurnOff", 19 | "score": 0.0224888548 20 | } 21 | ], 22 | "entities": [ 23 | { 24 | "entity": "hall", 25 | "type": "HomeAutomation.Room", 26 | "startIndex": 12, 27 | "endIndex": 15, 28 | "score": 0.8429257 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /examples/azure-function-application-insights-endpoint/run.original.csx: -------------------------------------------------------------------------------- 1 | /* DO NOT USE THIS CODE - THIS IS USED IN THE DOCUMENTATION ONLY */ 2 | using System.Net; 3 | 4 | public static async Task Run(HttpRequestMessage req, TraceWriter log) 5 | { 6 | log.Info("C# HTTP trigger function processed a request."); 7 | 8 | // parse query parameter 9 | string name = req.GetQueryNameValuePairs() 10 | .FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0) 11 | .Value; 12 | 13 | // Get request body 14 | dynamic data = await req.Content.ReadAsAsync(); 15 | 16 | // Set name to query string or body data 17 | name = name ?? data?.name; 18 | 19 | return name == null 20 | ? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body") 21 | : req.CreateResponse(HttpStatusCode.OK, "Hello " + name); 22 | } -------------------------------------------------------------------------------- /examples/azure-function-endpoint/function-app-vs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/azure-function-endpoint/function-app-vs.png -------------------------------------------------------------------------------- /examples/azure-function-endpoint/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "function", 5 | "name": "req", 6 | "type": "httpTrigger", 7 | "direction": "in" 8 | }, 9 | { 10 | "name": "$return", 11 | "type": "http", 12 | "direction": "out" 13 | } 14 | ], 15 | "disabled": true 16 | } -------------------------------------------------------------------------------- /examples/backup/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /examples/backup/find.js: -------------------------------------------------------------------------------- 1 | 2 | const request = require("requestretry"); 3 | const async = require('async'); 4 | const fs = require('fs-extra'); 5 | const moment = require('moment'); 6 | const path = require("path"); 7 | 8 | const backupFile = require("./backup.json"); 9 | 10 | const findHierarchicalEntities = (value) =>{ 11 | 12 | const hierarchicalEntityObjects = value.entities.filter(entity => { 13 | if (entity.children) { 14 | return entity.name; 15 | } 16 | }); 17 | 18 | return hierarchicalEntityObjects.map(x => x.name); 19 | } 20 | 21 | const findCompositeEntities = (value) =>{ 22 | 23 | return value.composites.map(composite => { 24 | return composite.name; 25 | }); 26 | } 27 | 28 | // find all apps with heirarchical entities 29 | backupFile.apps.forEach(app => { 30 | 31 | app.properties.forEach(property => { 32 | 33 | if(property.route == 'versionExports'){ 34 | 35 | // get version name 36 | property.values.forEach(value => { 37 | 38 | // check version for deprecated items 39 | const name = value.name; 40 | const version = value.versionId; 41 | 42 | const hierarchicalEntities = findHierarchicalEntities(value); 43 | hierarchicalEntities.length>0? console.log(`'${name}' '${version}' 'HIER=${hierarchicalEntities.join(",")}'`) : null; 44 | 45 | const compositeEntities = findCompositeEntities(value); 46 | compositeEntities.length>0? console.log(`'${name}' '${version}' 'COMP=${compositeEntities.join(",")}'`) : null; 47 | }) 48 | } 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /examples/backup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LUIS-backup", 3 | "version": "1.0.0", 4 | "description": "Backup all LUIS applications for given programmatic key", 5 | "main": "backup.js", 6 | "scripts": { 7 | "start": "node backup.js" 8 | }, 9 | "license": "ISC", 10 | "dependencies": { 11 | "async": "^2.5.0", 12 | "fs-extra": "^4.0.2", 13 | "moment": "^2.19.1", 14 | "request": "^2.83.0", 15 | "requestretry": "^1.12.2", 16 | "underscore": "^1.8.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/backup/readme.md: -------------------------------------------------------------------------------- 1 | # Backup all apps 2 | This Node.js file backups up all your LUIS apps: 3 | - settings 4 | - endpoints 5 | - versions 6 | 7 | ## Prerequisites 8 | - Lastest version of Node.js. 9 | - Install dependencies from package.json with `npm install` 10 | - In the backup.js file, change to programmaticKey to your own key. 11 | 12 | ## Run backup 13 | - From command line, `npm start' or 'node backup.js' 14 | 15 | ## Review backup 16 | **backup.json** is a json tree structure of each app with the information about each app. 17 | -------------------------------------------------------------------------------- /examples/bing-spell-check/javascript/readme.md: -------------------------------------------------------------------------------- 1 | # LUIS Query with spell check 2 | 3 | This Javascript example sends a query to the LUIS endpoint with Bing Spell Check turned on. This example corrects any misspelling with your own Bing Spell Check ID before it is submitted to the public IoT LUIS app. 4 | 5 | ![Results from LUIS with corrected query](screenshot.png) 6 | 7 | ## Prerequisites 8 | * [Bing Spell Check](https://azure.microsoft.com/en-us/services/cognitive-services/spell-check/) subscription. 9 | * [LUIS](https://azure.microsoft.com/en-us/services/cognitive-services/language-understanding-intelligent-service/) subscription. 10 | 11 | ## Misspelled query 12 | The query `turn the lighzs on` is misspelled on purpose. When the query is run, the response will include the `alteredQuery` field -- the text of the query submitted to LUIS. 13 | 14 | -------------------------------------------------------------------------------- /examples/bing-spell-check/javascript/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/bing-spell-check/javascript/screenshot.png -------------------------------------------------------------------------------- /examples/build-app-programmatically-csv/IoT.csv: -------------------------------------------------------------------------------- 1 | RequestType,Utterance,Operation,Device,Room,timestamp 2 | TurnOn,Turn on the lights,on,lights,,11/09/2017 04:01 PM 3 | TurnOn,Turn the heat on,on,heat,,11/09/2017 03:49 PM 4 | TurnOn,Switch on the kitchen fan,on,fan,kitchen,11/09/2017 03:29 PM 5 | TurnOff,Turn off bedroom lights,off,lights,bedroom,11/09/2017 03:27 PM 6 | TurnOff,Turn off air conditioning,off,air conditioning,,11/09/2017 03:22 PM 7 | TurnOff,kill the lights,,lights,,11/09/2017 02:49 PM 8 | Dim,dim the lights,dim,lights,,11/09/2017 02:43 PM 9 | Other,hi how are you,,,,11/09/2017 02:39 PM 10 | Other,answer the phone,,phone,,11/09/2017 01:19 PM 11 | Other,are you there,,,,11/09/2017 01:08 PM 12 | Other,help,,,,11/09/2017 12:40 PM 13 | Other,testing the circuit,,,,11/09/2017 12:39 PM 14 | -------------------------------------------------------------------------------- /examples/build-app-programmatically-csv/images/csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/build-app-programmatically-csv/images/csv.png -------------------------------------------------------------------------------- /examples/build-app-programmatically-csv/images/download-querylog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/build-app-programmatically-csv/images/download-querylog.png -------------------------------------------------------------------------------- /examples/build-app-programmatically-csv/images/imported-utterances.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/build-app-programmatically-csv/images/imported-utterances.png -------------------------------------------------------------------------------- /examples/build-app-programmatically-csv/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-app-from-csv", 3 | "version": "1.0.0", 4 | "description": "Use Microsoft LUIS Authoring API to build a LUIS app from utterance examples from a CSV format.", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "v-demak", 10 | "license": "ISC", 11 | "dependencies": { 12 | "babyparse": "^0.4.6", 13 | "bluebird": "^3.5.1", 14 | "fs-extra": "^4.0.2", 15 | "line-reader": "^0.4.0", 16 | "request": "^2.83.0", 17 | "request-promise": "^4.2.2", 18 | "requestretry": "^1.12.2" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/createFromPrebuiltDomain/index.js: -------------------------------------------------------------------------------- 1 | const request = require("request-promise"); 2 | 3 | // authoring key, available in luis.ai under Account Settings 4 | const LUIS_authoringKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; 5 | 6 | var createAppFromPrebuiltDomainPromise = async () => { 7 | try { 8 | return await request.post({ 9 | uri: "https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/customprebuiltdomains", 10 | method: 'POST', 11 | headers: { 12 | 'Ocp-Apim-Subscription-Key': LUIS_authoringKey 13 | }, 14 | json: true, 15 | body: { 16 | "domainName": "Web", 17 | "culture": "en-us" 18 | } 19 | }); 20 | } catch (err) { 21 | throw err; 22 | } 23 | } 24 | 25 | var deleteApp = async(appID) => { 26 | try { 27 | 28 | let uri = "https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/" + appID; 29 | console.log(uri); 30 | return await request.post({ 31 | uri: uri, 32 | method: 'DELETE', 33 | headers: { 34 | 'Ocp-Apim-Subscription-Key': LUIS_authoringKey 35 | } 36 | }); 37 | } catch (err) { 38 | throw err; 39 | } 40 | } 41 | 42 | createAppFromPrebuiltDomainPromise().then((results)=>{ 43 | console.log(results); 44 | return deleteApp(results); 45 | }).then(results2 => { 46 | console.log("done"); 47 | }).catch(err => { 48 | console.log(err); 49 | }) 50 | -------------------------------------------------------------------------------- /examples/createFromPrebuiltDomain/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "createFromPrebuiltDomain", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "request": "^2.85.0", 14 | "request-promise": "^4.2.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/demo-upload-endpoint-utterances/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-upload-utterances-from-review-endpoint-utterances", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "https": "^1.0.0", 14 | "querystring": "^0.2.0", 15 | "request": "^2.87.0", 16 | "requestretry": "^1.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/demo-upload-example-utterances/demo-Upload-utterances-from-querylog/README.md: -------------------------------------------------------------------------------- 1 | # Upload utterances from Query log 2 | This demonstration app shows how to import queries from an application's query log from [luis.ai](http://www.luis.ai). 3 | 4 | To export a LUIS app's query log, select the app in the My Apps screen, then select **Export endpoint logs.** 5 | 6 | ![Export icon button on luis.ai](./media/download-querylog.png) 7 | 8 | Change the `downloadFile` value in the `index.js` file to the location and name of your file. Follow the rest of the [instructions for the demonstration apps](../README.md). 9 | 10 | ### Format of Query log 11 | The format of the query log is a CSV file with a heading row. The parsing needs to ignore the first two columns and focus on the third column. 12 | 13 | ```` 14 | "Query","UTC DateTime","Response" 15 | "go to paris",10/04/2017 17:56:05,"{""query"":""go to paris"",""intents"":[{""intent"":""BookFlight"",""score"":0.9999256},{""intent"":""None"",""score"":0.16970253}],""entities"":[{""entity"":""paris"",""type"":""Location::LocationTo"",""startIndex"":6,""endIndex"":10,""score"":0.797421634}]}" 16 | "ticket to paris",10/04/2017 18:15:58,"{""query"":""ticket to paris"",""intents"":[{""intent"":""BookFlight"",""score"":0.9999747},{""intent"":""None"",""score"":0.149017587}],""entities"":[{""entity"":""paris"",""type"":""Location::LocationTo"",""startIndex"":10,""endIndex"":14,""score"":0.9220803}]}" 17 | 18 | ```` 19 | -------------------------------------------------------------------------------- /examples/demo-upload-example-utterances/demo-Upload-utterances-from-querylog/media/download-querylog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/demo-upload-example-utterances/demo-Upload-utterances-from-querylog/media/download-querylog.png -------------------------------------------------------------------------------- /examples/demo-upload-example-utterances/demo-Upload-utterances-from-querylog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-Upload-utterances-from-querylog", 3 | "version": "1.0.0", 4 | "description": "Use Microsoft LUIS api to upload utterance examples from query log.", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "v-geberr", 10 | "license": "ISC", 11 | "dependencies": { 12 | "babyparse": "^0.4.6", 13 | "bluebird": "^3.5.1", 14 | "fs-extra": "^4.0.2", 15 | "line-reader": "^0.4.0", 16 | "request": "^2.83.0", 17 | "request-promise": "^4.2.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/demo-upload-example-utterances/demo-upload-utterances-from-exported-luis-app/README.md: -------------------------------------------------------------------------------- 1 | # Upload utterances from exported LUIS app 2 | This demonstration app shows how to import queries from an application that has been exported from [luis.ai](http://www.luis.ai). 3 | 4 | To export a LUIS app, switch to the app's Manage page, then choose Versions from the sidebar. Select the version of the app to be exported, then select **Export**. 5 | 6 | ![Export LUIS app from luis.ai](./media/export-app-data.png) 7 | 8 | Change the `exportFile` value in the `index.js` file to the location and name of your file. Follow the rest of the [instructions for the demonstration apps](../README.md). 9 | 10 | ### Format of Exported app 11 | The format of the exported app is a JSON file containing all the app's data, including the utterances. Only the utterances array needs to be parsed because the property names for the batch upload JSON are different. 12 | 13 | ```` 14 | { 15 | "utterances": [ 16 | { 17 | "text": "turn on the lights", 18 | "intent": "TurnAllOn", 19 | "entities": [] 20 | }, 21 | { 22 | "text": "turn the lights off", 23 | "intent": "TurnAllOff", 24 | "entities": [] 25 | } 26 | ] 27 | } 28 | ```` 29 | -------------------------------------------------------------------------------- /examples/demo-upload-example-utterances/demo-upload-utterances-from-exported-luis-app/index.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | const parse = require('./_parse'); 4 | const upload = require('./_upload'); 5 | 6 | // TBD: CHANGE THESE VALUES 7 | const LUIS_subscriptionKey = "YOUR_SUBSCRIPTION_KEY"; 8 | const LUIS_appId = "YOUR_APP_ID"; 9 | 10 | const LUIS_versionId = "LightsOnly"; 11 | 12 | // NOTE: final output of upload api named utterances.upload.json 13 | const exportFile= "./example-files/exported-luis-app-utterances.json"; 14 | const uploadFile = "./utterances.json" 15 | 16 | /* parse configuration */ 17 | var configParse = { 18 | inFile: path.join(__dirname, exportFile), 19 | outFile: path.join(__dirname, uploadFile) 20 | }; 21 | /* upload configuration */ 22 | var configUpload = { 23 | LUIS_subscriptionKey: LUIS_subscriptionKey, 24 | LUIS_appId: LUIS_appId, 25 | LUIS_versionId: LUIS_versionId, 26 | batchSize: 100, 27 | inFile: configParse.outFile, 28 | uri: "https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/{appId}/versions/{versionId}/examples".replace("{appId}", LUIS_appId).replace("{versionId}", LUIS_versionId) 29 | }; 30 | 31 | parse(configParse) 32 | .then( () => { 33 | return upload(configUpload); 34 | }).then( () => { 35 | console.log("process done"); 36 | }).catch(err => { 37 | console.log(err); 38 | }); -------------------------------------------------------------------------------- /examples/demo-upload-example-utterances/demo-upload-utterances-from-exported-luis-app/media/export-app-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/demo-upload-example-utterances/demo-upload-utterances-from-exported-luis-app/media/export-app-data.png -------------------------------------------------------------------------------- /examples/demo-upload-example-utterances/demo-upload-utterances-from-exported-luis-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-Upload-utterances-from-exported-luis-app", 3 | "version": "1.0.0", 4 | "description": "Use Microsoft LUIS api to upload utterance examples from exported LUIS app.", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "v-geberr", 10 | "license": "ISC", 11 | "dependencies": { 12 | "bluebird": "^3.5.1", 13 | "fs-extra": "^4.0.2", 14 | "request": "^2.83.0", 15 | "request-promise": "^4.2.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/deprecated/README.md: -------------------------------------------------------------------------------- 1 | ## Deprecated Features 2 | 3 | The __[Pattern feature][LuisFeatures]__ which helped recognize words and phrases that follow a pattern defined by a regular expression, has been deprecated. In the current version of LUIS, if you have entities that follow a pattern, simply label examples of them. The functionality to add pattern features to a LUIS app has been removed. However, if you have existing LUIS apps that implement a pattern feature, they will be supported until December 2018. 4 | 5 | 6 | ___ 7 | 8 | 9 | 10 | Additional reading on __[LUIS Features][LuisFeatures]__ can be found here. 11 | 12 | 13 | [Intents]: ./screenshots/intents.png 14 | [Entity]: ./screenshots/name-entity.png 15 | [Utterances]: ./screenshots/hyphen-utterances.png 16 | [PatternFeatures]: ./screenshots/pattern-features.png 17 | [AddPattern]: ./screenshots/add-pattern.png 18 | [InteractiveTest]: ./screenshots/interactive-test.png 19 | 20 | 21 | [SampleHyphenatedNamesModel]: ./hyphenated-names.json 22 | [LuisFeatures]: https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-concept-feature -------------------------------------------------------------------------------- /examples/notes-app/csharp/NoteApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoteApp", "NoteApp\NoteApp.csproj", "{2B2ECFE8-030F-474C-B1FA-726D9D407CAE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2B2ECFE8-030F-474C-B1FA-726D9D407CAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2B2ECFE8-030F-474C-B1FA-726D9D407CAE}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2B2ECFE8-030F-474C-B1FA-726D9D407CAE}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2B2ECFE8-030F-474C-B1FA-726D9D407CAE}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {E9D6B53B-8731-4B65-AEAB-2F0E1A7D7D62} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/notes-app/csharp/NoteApp/NoteApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/notes-app/node/.env: -------------------------------------------------------------------------------- 1 | LUIS_SUBSCRIPTION_KEY= -------------------------------------------------------------------------------- /examples/notes-app/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # BUILD IMAGE 2 | # $ docker build --no-cache -t notes-app-node . 3 | # 4 | # RUN CODE 5 | # 6 | # WINDOWS BASH COMMAND 7 | # $ winpty docker run -it --rm --name notes-app-node notes-app-node 8 | # 9 | # NON-WINDOWS 10 | # $ docker run -it --rm --name notes-app-node notes-app-node tail 11 | 12 | FROM node:latest 13 | COPY . /usr/src/LUIS 14 | WORKDIR /usr/src/LUIS 15 | RUN npm install 16 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /examples/notes-app/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node", 3 | "version": "1.0.0", 4 | "description": "This example creates a LUIS app using the prebuilt domain \"Note\"", 5 | "main": "notes.js", 6 | "scripts": { 7 | "start": "node notes.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "dotenv": "^6.2.0", 15 | "querystring": "^0.2.0", 16 | "request": "^2.88.0", 17 | "request-promise": "^4.2.2", 18 | "requestretry": "^3.1.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/phrase_list/screenshots/AddingValuestoWantPhraseList.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/phrase_list/screenshots/AddingValuestoWantPhraseList.PNG -------------------------------------------------------------------------------- /examples/phrase_list/screenshots/IRequireAComputerReplacement_AfterPhraseList.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/phrase_list/screenshots/IRequireAComputerReplacement_AfterPhraseList.PNG -------------------------------------------------------------------------------- /examples/phrase_list/screenshots/IRequireAComputerReplacement_BeforePhraseList.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/phrase_list/screenshots/IRequireAComputerReplacement_BeforePhraseList.PNG -------------------------------------------------------------------------------- /examples/phrase_list/screenshots/PhraseListStart.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/phrase_list/screenshots/PhraseListStart.PNG -------------------------------------------------------------------------------- /examples/phrase_list/screenshots/PhraseList_RelatedValues.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/examples/phrase_list/screenshots/PhraseList_RelatedValues.PNG -------------------------------------------------------------------------------- /examples/simple-bot-example/README.md: -------------------------------------------------------------------------------- 1 | # Example LUIS apps for simple bots 2 | 3 | These examples provide LUIS apps to demonstrate basic bot-building scenarios. 4 | 5 | ## How to use 6 | 7 | 1. Download the JSON file. 8 | 2. Log into [luis.ai](https://www.luis.ai) 9 | 3. in the **My apps** tab, click on the **Import new app** button and choose the JSON file for the app to import. 10 | 11 | ## Simple Bot Example 12 | 13 | * [Simple bot example](./FirstSimpleBotExample.json): This LUIS app has the following intents: Help, Cancel, None, Weather, OrderFood. It has the Weather.Location and datetimeV2 entities. 14 | 15 | ## Bot Example with Dialogs and Entities 16 | * [Bot example with dialogs and entities](./WeatherOrHomeAutomation.json): This LUIS app has the following intents: weather, homeautomation, and None. It has the Weather.Location and datetimeV2 entities. 17 | 18 | -------------------------------------------------------------------------------- /examples/upgrading_luis_tier/README.md: -------------------------------------------------------------------------------- 1 | Refer to the LUIS [documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/azureibizasubscription#change-luis-pricing-tier) to learn how to change pricing tier. 2 | -------------------------------------------------------------------------------- /media/docker-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/cognitive-services-language-understanding/ca61c2c3b7bfa158f50fa01c7013e5c246af3439/media/docker-logo.png --------------------------------------------------------------------------------