├── .gitignore ├── Assets ├── Add-direct-line.png ├── Capability-microphone.PNG ├── Create-endpoint.png ├── Import-language-data.png ├── JFKBot.png ├── JFKBotEmulator.png ├── JFKFiles.png ├── JFKNuget.png ├── NugetPackageManager.JPG ├── Publish2.JPG ├── QnAMakerEndpoints.JPG ├── QnAMakerService.JPG ├── TextAnalyticsDeploy.png ├── TextAnalyticsSearch.png ├── WebAppBot.png ├── WebAppBotDeploy.png ├── adaptiondata.PNG ├── add-bot-name-key.png ├── add-key-luis.png ├── all-app-service.png ├── alt-question-kb.png ├── bing-spell-check-enabled.png ├── bot-secret-key.png ├── bot-secret-location.png ├── configure-ngrok.png ├── create-endpoing2.png ├── create-language-model.png ├── create-model.png ├── crissubscriptions.png ├── directline-done.png ├── directline-keys.png ├── download-bot-code.png ├── download-zip.png ├── emulator.png ├── enable-directline.png ├── export-json.png ├── export-luis-app.png ├── import-json.png ├── import-pronunciation-data.JPG ├── import-voice-data.png ├── instantiation.png ├── local-host.png ├── luis-authoring-key.png ├── open-kudu-console.png ├── open-online-code-editor.png ├── publish.png ├── recycle-bot.png ├── study-bot-interface.PNG ├── use-speech.png └── view-code.png ├── JFK-Example ├── JFKHooverBotTemplate.txt ├── README.md ├── bot1 │ ├── EchoWithCounterBot.cs │ ├── Program.cs │ ├── Startup.cs │ ├── appsettings.json │ └── cia-cryptonyms.json ├── bot2 │ └── EchoWithCounterBot.cs ├── bot3 │ └── EchoWithCounterBot.cs ├── speech │ ├── cryptonyms.txt │ └── questions.txt ├── voice │ ├── audio.zip │ └── transcript.txt ├── wwwroot1 │ ├── bot.htm │ ├── default.htm │ ├── footer.png │ ├── hoover.jpg │ ├── icon.png │ ├── settings.js │ └── title.png ├── wwwroot2 │ └── bot.htm └── wwwroot3 │ ├── bot.htm │ └── microsoft.cognitiveservices.speech.sdk.bundle-min.js ├── README.md └── Study-bot-example ├── Qna-Luis-Bot-v4 ├── BotServices.cs ├── FAQs │ ├── Chitchat.tsv │ ├── StudyBiology.tsv │ ├── StudyGeology.tsv │ └── StudySociology.tsv ├── NlpDispatchBot.cs ├── README.md └── Startup.cs ├── README.md ├── StudyBot ├── Build-the-StudyBot.md ├── README.md ├── SpeechCode.cs ├── StudyBot.sln └── StudyBot │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ ├── Wide310x150Logo.scale-200.png │ ├── directline-done.png │ ├── enable-directline.png │ └── robot-face.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml │ ├── StudyBot.bot │ ├── StudyBot.csproj │ └── Util.cs └── StudyBotTemplate.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /Assets/Add-direct-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/Add-direct-line.png -------------------------------------------------------------------------------- /Assets/Capability-microphone.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/Capability-microphone.PNG -------------------------------------------------------------------------------- /Assets/Create-endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/Create-endpoint.png -------------------------------------------------------------------------------- /Assets/Import-language-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/Import-language-data.png -------------------------------------------------------------------------------- /Assets/JFKBot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/JFKBot.png -------------------------------------------------------------------------------- /Assets/JFKBotEmulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/JFKBotEmulator.png -------------------------------------------------------------------------------- /Assets/JFKFiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/JFKFiles.png -------------------------------------------------------------------------------- /Assets/JFKNuget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/JFKNuget.png -------------------------------------------------------------------------------- /Assets/NugetPackageManager.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/NugetPackageManager.JPG -------------------------------------------------------------------------------- /Assets/Publish2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/Publish2.JPG -------------------------------------------------------------------------------- /Assets/QnAMakerEndpoints.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/QnAMakerEndpoints.JPG -------------------------------------------------------------------------------- /Assets/QnAMakerService.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/QnAMakerService.JPG -------------------------------------------------------------------------------- /Assets/TextAnalyticsDeploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/TextAnalyticsDeploy.png -------------------------------------------------------------------------------- /Assets/TextAnalyticsSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/TextAnalyticsSearch.png -------------------------------------------------------------------------------- /Assets/WebAppBot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/WebAppBot.png -------------------------------------------------------------------------------- /Assets/WebAppBotDeploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/WebAppBotDeploy.png -------------------------------------------------------------------------------- /Assets/adaptiondata.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/adaptiondata.PNG -------------------------------------------------------------------------------- /Assets/add-bot-name-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/add-bot-name-key.png -------------------------------------------------------------------------------- /Assets/add-key-luis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/add-key-luis.png -------------------------------------------------------------------------------- /Assets/all-app-service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/all-app-service.png -------------------------------------------------------------------------------- /Assets/alt-question-kb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/alt-question-kb.png -------------------------------------------------------------------------------- /Assets/bing-spell-check-enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/bing-spell-check-enabled.png -------------------------------------------------------------------------------- /Assets/bot-secret-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/bot-secret-key.png -------------------------------------------------------------------------------- /Assets/bot-secret-location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/bot-secret-location.png -------------------------------------------------------------------------------- /Assets/configure-ngrok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/configure-ngrok.png -------------------------------------------------------------------------------- /Assets/create-endpoing2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/create-endpoing2.png -------------------------------------------------------------------------------- /Assets/create-language-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/create-language-model.png -------------------------------------------------------------------------------- /Assets/create-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/create-model.png -------------------------------------------------------------------------------- /Assets/crissubscriptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/crissubscriptions.png -------------------------------------------------------------------------------- /Assets/directline-done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/directline-done.png -------------------------------------------------------------------------------- /Assets/directline-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/directline-keys.png -------------------------------------------------------------------------------- /Assets/download-bot-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/download-bot-code.png -------------------------------------------------------------------------------- /Assets/download-zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/download-zip.png -------------------------------------------------------------------------------- /Assets/emulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/emulator.png -------------------------------------------------------------------------------- /Assets/enable-directline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/enable-directline.png -------------------------------------------------------------------------------- /Assets/export-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/export-json.png -------------------------------------------------------------------------------- /Assets/export-luis-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/export-luis-app.png -------------------------------------------------------------------------------- /Assets/import-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/import-json.png -------------------------------------------------------------------------------- /Assets/import-pronunciation-data.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/import-pronunciation-data.JPG -------------------------------------------------------------------------------- /Assets/import-voice-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/import-voice-data.png -------------------------------------------------------------------------------- /Assets/instantiation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/instantiation.png -------------------------------------------------------------------------------- /Assets/local-host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/local-host.png -------------------------------------------------------------------------------- /Assets/luis-authoring-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/luis-authoring-key.png -------------------------------------------------------------------------------- /Assets/open-kudu-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/open-kudu-console.png -------------------------------------------------------------------------------- /Assets/open-online-code-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/open-online-code-editor.png -------------------------------------------------------------------------------- /Assets/publish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/publish.png -------------------------------------------------------------------------------- /Assets/recycle-bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/recycle-bot.png -------------------------------------------------------------------------------- /Assets/study-bot-interface.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/study-bot-interface.PNG -------------------------------------------------------------------------------- /Assets/use-speech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/use-speech.png -------------------------------------------------------------------------------- /Assets/view-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Assets/view-code.png -------------------------------------------------------------------------------- /JFK-Example/JFKHooverBotTemplate.txt: -------------------------------------------------------------------------------- 1 | Bot Path & Secret 2 | "botFilePath": "from Application Settings blade of your Web App Bot (under Application Settings heading)", 3 | "botFileSecret": "from Application Settings blade of your Web App Bot (under Application Settings heading)", 4 | 5 | Azure Search Info: 6 | "searchName": "", 8 | "searchIndex": "jfkindex", 9 | "searchUrl": "https://.azurewebsites.net/#/search?term=", 10 | "textAnalyticsKey": "", 11 | "textAnalyticsEndpoint": "https://.api.cognitive.microsoft.com" 12 | 13 | Bot Directline Secret 14 | const botSecret = "from the Direct Line channel in the Channels blade of your Web App Bot"; 15 | 16 | Custom Voice & Speech Models. To be provided 17 | const speechKey = ""; 18 | const speechRecognitionEndpoint = ""; 19 | const speechSynthesisEndpoint = ""; 20 | const speechRegion = "westus"; 21 | const tokenEndpoint = "https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken"; 22 | 23 | 24 | Deployment Info. Get this from PostDeployScripts/.PublishSettings 25 | msdeploySite="" 26 | userName="" 27 | userPWD="" -------------------------------------------------------------------------------- /JFK-Example/bot1/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 | BuildWebHost(args).Run(); 15 | } 16 | 17 | public static IWebHost BuildWebHost(string[] args) => 18 | WebHost.CreateDefaultBuilder(args) 19 | .ConfigureLogging((hostingContext, logging) => 20 | { 21 | // Add Azure Logging 22 | logging.AddAzureWebAppDiagnostics(); 23 | 24 | // Logging level - set to Trace to see each step of the bot's work 25 | // logging.SetMinimumLevel(LogLevel.Trace); 26 | 27 | // Logging Options. 28 | // There are other logging options available: 29 | // https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1 30 | // logging.AddDebug(); 31 | // logging.AddConsole(); 32 | }) 33 | 34 | // Logging Options. 35 | // Consider using Application Insights for your logging and metrics needs. 36 | // https://azure.microsoft.com/en-us/services/application-insights/ 37 | // .UseApplicationInsights() 38 | .UseStartup() 39 | .Build(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /JFK-Example/bot1/Startup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using System; 5 | using System.IO; 6 | using System.Linq; 7 | using Microsoft.AspNetCore.Builder; 8 | using Microsoft.AspNetCore.Hosting; 9 | using Microsoft.Bot.Builder; 10 | using Microsoft.Bot.Builder.BotFramework; 11 | using Microsoft.Bot.Builder.Integration; 12 | using Microsoft.Bot.Builder.Integration.AspNet.Core; 13 | using Microsoft.Bot.Configuration; 14 | using Microsoft.Bot.Connector.Authentication; 15 | using Microsoft.Extensions.Configuration; 16 | using Microsoft.Extensions.DependencyInjection; 17 | using Microsoft.Extensions.Logging; 18 | using Microsoft.Extensions.Options; 19 | 20 | namespace Microsoft.BotBuilderSamples 21 | { 22 | /// 23 | /// The Startup class configures services and the request pipeline. 24 | /// 25 | public class Startup 26 | { 27 | public static IConfiguration Configuration; 28 | 29 | private ILoggerFactory _loggerFactory; 30 | private bool _isProduction = false; 31 | 32 | /// 33 | /// Gets the configuration that represents a set of key/value application configuration properties. 34 | /// 35 | /// 36 | /// The that represents a set of key/value application configuration properties. 37 | /// 38 | public Startup(IHostingEnvironment env) 39 | { 40 | _isProduction = env.IsProduction(); 41 | 42 | var builder = new ConfigurationBuilder() 43 | .SetBasePath(env.ContentRootPath) 44 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 45 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) 46 | .AddEnvironmentVariables(); 47 | 48 | Configuration = builder.Build(); 49 | } 50 | 51 | /// 52 | /// This method gets called by the runtime. Use this method to add services to the container. 53 | /// 54 | /// The specifies the contract for a collection of service descriptors. 55 | /// 56 | /// 57 | /// 58 | public void ConfigureServices(IServiceCollection services) 59 | { 60 | services.AddBot(options => 61 | { 62 | // Creates a logger for the application to use. 63 | ILogger logger = _loggerFactory.CreateLogger(); 64 | 65 | var secretKey = Configuration.GetSection("botFileSecret")?.Value; 66 | var botFilePath = Configuration.GetSection("botFilePath")?.Value; 67 | if (!File.Exists(botFilePath)) 68 | { 69 | throw new FileNotFoundException($"The .bot configuration file was not found. botFilePath: {botFilePath}"); 70 | } 71 | 72 | // Loads .bot configuration file and adds a singleton that your Bot can access through dependency injection. 73 | BotConfiguration botConfig = null; 74 | try 75 | { 76 | botConfig = BotConfiguration.Load(botFilePath ?? @".\BotConfiguration.bot", secretKey); 77 | } 78 | catch 79 | { 80 | var msg = @"Error reading bot file. Please ensure you have valid botFilePath and botFileSecret set for your environment. 81 | - You can find the botFilePath and botFileSecret in the Azure App Service application settings. 82 | - If you are running this bot locally, consider adding a appsettings.json file with botFilePath and botFileSecret. 83 | - See https://aka.ms/about-bot-file to learn more about .bot file its use and bot configuration. 84 | "; 85 | logger.LogError(msg); 86 | throw new InvalidOperationException(msg); 87 | } 88 | 89 | services.AddSingleton(sp => botConfig); 90 | 91 | // Retrieve current endpoint. 92 | var environment = _isProduction ? "production" : "development"; 93 | var service = botConfig.Services.FirstOrDefault(s => s.Type == "endpoint" && s.Name == environment); 94 | if (service == null && _isProduction) 95 | { 96 | // Attempt to load development environment 97 | service = botConfig.Services.Where(s => s.Type == "endpoint" && s.Name == "development").FirstOrDefault(); 98 | logger.LogWarning("Attempting to load development endpoint in production environment."); 99 | } 100 | 101 | if (!(service is EndpointService endpointService)) 102 | { 103 | throw new InvalidOperationException($"The .bot file does not contain an endpoint with name '{environment}'."); 104 | } 105 | 106 | options.CredentialProvider = new SimpleCredentialProvider(endpointService.AppId, endpointService.AppPassword); 107 | options.ChannelProvider = new ConfigurationChannelProvider(Configuration); 108 | 109 | // Catches any errors that occur during a conversation turn and logs them. 110 | options.OnTurnError = async (context, exception) => 111 | { 112 | logger.LogError($"Exception caught : {exception}"); 113 | await context.SendActivityAsync($"Sorry, it looks like something went wrong."); 114 | }; 115 | 116 | // The Memory Storage used here is for local bot debugging only. When the bot 117 | // is restarted, everything stored in memory will be gone. 118 | IStorage dataStore = new MemoryStorage(); 119 | 120 | // For production bots use the Azure Blob or 121 | // Azure CosmosDB storage providers. For the Azure 122 | // based storage providers, add the Microsoft.Bot.Builder.Azure 123 | // Nuget package to your solution. That package is found at: 124 | // https://www.nuget.org/packages/Microsoft.Bot.Builder.Azure/ 125 | // Uncomment the following lines to use Azure Blob Storage 126 | // Storage configuration name or ID from the .bot file. 127 | // const string StorageConfigurationId = ""; 128 | // var blobConfig = botConfig.FindServiceByNameOrId(StorageConfigurationId); 129 | // if (!(blobConfig is BlobStorageService blobStorageConfig)) 130 | // { 131 | // throw new InvalidOperationException($"The .bot file does not contain an blob storage with name '{StorageConfigurationId}'."); 132 | // } 133 | // // Default container name. 134 | // const string DefaultBotContainer = "botstate"; 135 | // var storageContainer = string.IsNullOrWhiteSpace(blobStorageConfig.Container) ? DefaultBotContainer : blobStorageConfig.Container; 136 | // IStorage dataStore = new Microsoft.Bot.Builder.Azure.AzureBlobStorage(blobStorageConfig.ConnectionString, storageContainer); 137 | 138 | // Create Conversation State object. 139 | // The Conversation State object is where we persist anything at the conversation-scope. 140 | var conversationState = new ConversationState(dataStore); 141 | 142 | options.State.Add(conversationState); 143 | }); 144 | 145 | // Create and register state accessors. 146 | // Accessors created here are passed into the IBot-derived class on every turn. 147 | services.AddSingleton(sp => 148 | { 149 | var options = sp.GetRequiredService>().Value; 150 | if (options == null) 151 | { 152 | throw new InvalidOperationException("BotFrameworkOptions must be configured prior to setting up the state accessors"); 153 | } 154 | 155 | var conversationState = options.State.OfType().FirstOrDefault(); 156 | if (conversationState == null) 157 | { 158 | throw new InvalidOperationException("ConversationState must be defined and added before adding conversation-scoped state accessors."); 159 | } 160 | 161 | // Create the custom state accessor. 162 | // State accessors enable other components to read and write individual properties of state. 163 | var accessors = new EchoBotAccessors(conversationState) 164 | { 165 | CounterState = conversationState.CreateProperty(EchoBotAccessors.CounterStateName), 166 | }; 167 | 168 | return accessors; 169 | }); 170 | } 171 | 172 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 173 | { 174 | _loggerFactory = loggerFactory; 175 | 176 | app.UseDefaultFiles() 177 | .UseStaticFiles() 178 | .UseBotFramework(); 179 | } 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /JFK-Example/bot1/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "botFilePath": "from Application Settings blade of your Web App Bot (under Application Settings heading)", 3 | "botFileSecret": "from Application Settings blade of your Web App Bot (under Application Settings heading)", 4 | "searchName": "from Keys blade of your JFK Files search service (top of blade)", 5 | "searchKey": "from Keys blade of your JFK Files search service", 6 | "searchIndex": "jfkindex", 7 | "searchUrl": "https://jfk-site-hostname.azurewebsites.net/#/search?term=", 8 | "textAnalyticsKey": "from Keys blade of your Text Analytics resource", 9 | "textAnalyticsEndpoint": "https://westus.api.cognitive.microsoft.com" 10 | } 11 | -------------------------------------------------------------------------------- /JFK-Example/speech/cryptonyms.txt: -------------------------------------------------------------------------------- 1 | ZRWAHOO z r wahoo 2 | ZRWAGON z r wagon 3 | ZRTORCH z r torch 4 | ZRSOLO z r solo 5 | ZRSIGN z r sign 6 | ZRRIFLE zr rifle 7 | ZRPRIMA z r prima 8 | ZRPENNY z r penny 9 | ZRMETAL z r metal 10 | ZRKNICK z r knick 11 | ZRJOINT z r joint 12 | ZRGRACE z r grace 13 | ZRCLIFF z r cliff 14 | ZRCHEST z r chest 15 | ZRBEACH z r beach 16 | ZRALERT z r aleart 17 | ZRAFRAID z r afraid 18 | ZR z r 19 | ZOMBIE zombie 20 | ZODIAC zodiac 21 | ZIPPER zipper 22 | YOBELT yo belt 23 | YOACRE yo acre 24 | YEAST yeast 25 | WUMUTUAL w u mutual 26 | WUBRINY-1 w u briny one 27 | WUBRINY w u briny 28 | WUBONBON w u bonbon 29 | WSHOOFS w s hoofs 30 | WSCHILD w s child 31 | WSBURNT w s burnt 32 | WSACROBAT w s acrobat 33 | WS w s 34 | WOMUSE m d muse 35 | WOMACE m d mace 36 | WOHIVE m d hive 37 | WOFACT m d fact 38 | WOBONE m d bone 39 | WO m d 40 | WIROGUE w i rogue 41 | UNSTAR un star 42 | UNSNAFU-9 un snafu nine 43 | UNRUMBLE-2 un rumble two 44 | UN u n 45 | TWIXT twixt 46 | TPELIDE t p elide 47 | TOPAZ topaz 48 | TODHUNTER todd hunter 49 | TARBRUSH tar brush 50 | STESCALADE s t escalade 51 | SMOTH s m oth 52 | SM s m 53 | SLFREE-1 s l free one 54 | SLEEPER sleeper 55 | SKEWER-1 skewer one 56 | SGHOUSE sg house 57 | RYBAT rye bat 58 | REDWOOD red wood 59 | REDTOP red top 60 | REDSOX red socks 61 | REDSKIN red skin 62 | REDCOAT red coat 63 | REDCAP red cap 64 | QUSWIFT-7 q u swift seven 65 | QUSWIFT-1 q u swift one 66 | QUSPORT-1 q u sport one 67 | QUHOPS-1 q u hops one 68 | QKOPERA q k opera 69 | QKMAGNET q k magnet 70 | QKIVORY q k ivory 71 | QKHILLTOP q k hilltop 72 | QKGLACE q k glace 73 | QKFLOWAGE q k flowage 74 | QKENCHANT q k enchant 75 | QKACTIVE q k active 76 | QK q k 77 | QJWIN q j win 78 | QJBANNER-1 q j banner one 79 | QDELF q d elf 80 | QDDALE q d dale 81 | QDCOVE q d cove 82 | QDCHAR q d char 83 | QDBIAS q d bias 84 | QD q d 85 | PLVWBLANKET p l v w blanket 86 | PLMHABYSS p l m h abyss 87 | PEKLOK peck lock 88 | PBSWING p b swing 89 | PBSUCCESS p b success 90 | PBRUMEN p b rumen 91 | PBPRIME p b prime 92 | PBIMPULSE p b impulse 93 | PBHISTORY p b history 94 | PB p b 95 | PAWNEE-5 pawnee five 96 | PAWNEE-3 pawnee three 97 | PASSAVOY pass avoy 98 | PARAGON paragon 99 | PALP palp 100 | OWVL o w v l 101 | OPIM o p i m 102 | OLYMPUS olympus 103 | ODYOKE o d yoke 104 | ODWIFE o d wife 105 | ODURGE o d urge 106 | ODUNIT o d unit 107 | ODOATH o d oath 108 | ODINCH o d inch 109 | ODIBEX o d ibex 110 | ODFOAM o d foam 111 | ODENVY o d envy 112 | ODEARL o d earl 113 | ODBOON o d boon 114 | ODBEAT o d beat 115 | ODALOE o d aloe 116 | ODACID o d acid 117 | OD o d 118 | NOTLOX not lox 119 | NIEXIT-3 n i exit 120 | NEMOV-1 n e mov one 121 | MONGOOSE mongoose 122 | MKULTRA m k ultra 123 | MKTRAP m k trap 124 | MKTOPAZ m k topaz 125 | MKNAOMI m k naomi 126 | MKCHARITY m k charity 127 | MK m k 128 | MHVIPER m h viper 129 | MHORDER m h order 130 | MHDOWEL m h dowel 131 | MHCHILD m h child 132 | MHCHAOS m h chaos 133 | MHAPRON m h apron 134 | MH m h 135 | MERRIMAC merra mac 136 | LPOVER l p over 137 | LPHIDDEN l p hidden 138 | LNERGO l n ergo 139 | LNAGON l n agon 140 | LITENSOR l i tensor 141 | LITEMPO-8 l i tempo eight 142 | LITEMPO-4 l i tempo four 143 | LITEMPO-2 l i tempo two 144 | LITEMPO-12 l i tempo twelve 145 | LITEMPO-1 l i tempo one 146 | LITEMPO l i tempo 147 | LITAMIL-9 l i tamil nine 148 | LITAMIL-7 l i tamil seven 149 | LITAMIL-3 l i tamil three 150 | LITAMIL-2 l i tamil two 151 | LITAMIL-13 l i tamil thirteen 152 | LITAMIL-1 l i tamil one 153 | LITAMIL l i tamil 154 | LITAINT-7 l i taint seven 155 | LITAINT-5 l i taint five 156 | LITAINT-1 l i taint one 157 | LITAINT l i taint 158 | LITABBY l i tabby 159 | LISICLE-1 l i sicle one 160 | LISAMPAN l i sampan 161 | LIROMANCE l i romance 162 | LIRING-3 l i ring three 163 | LIRING-1 l i ring one 164 | LIRICE l i rice 165 | LIRAVINE li ravine 166 | LIPSTICK-20 lipstick twenty 167 | LIPSTICK lipstick 168 | LIPLUG l i plug 169 | LIOVAL-1 l i oval one 170 | LIOSAGE l i osage 171 | LIOOZE-1 l i ooze 172 | LIONION-2 l i onion two 173 | LIONION-1 l i onion one 174 | LIONION l i onion 175 | LINOODLE l i noodle 176 | LINLUCK l in luck 177 | LINILE-1 l i nile one 178 | LINEB-1 l i neb one 179 | LIMUST l i must 180 | LIMUD l i mud 181 | LIMOTOR l i motor 182 | LIMITED limited 183 | LIMEW l i new 184 | LIMESA l i mesa 185 | LIMERICK limerick 186 | LIMASK-1 l i mask one 187 | LILYRIC l i lyric 188 | LILISP l i lisp 189 | LIKAYAK-2 l i kayak two 190 | LIJERSEY l i jersey 191 | LIHUFF-2 l i huff two 192 | LIHUFF-1 l i huff one 193 | LIHUFF l i huff 194 | LIHABIT l i habit 195 | LIGAFF l i gaff 196 | LIFIRE l i fire 197 | LIFEUD-22 l i feud twenty two 198 | LIFEUD-2 l i feud two 199 | LIFEUD-1 l i feud one 200 | LIFEAT l i feat 201 | LIEVICT l i evict 202 | LIERODE l i erode 203 | LIENVOY-2 l i enjoy two 204 | LIENVOY-16 l i envoy sixteen 205 | LIENVOY l i envoy 206 | LIENTRAP l i entrap 207 | LIEMPTY-9 l i empty nine 208 | LIEMPTY-6 l i empty six 209 | LIEMPTY-2 l i empty two 210 | LIEMPTY-19 l i empty nineteen 211 | LIEMPTY-14 l i empty fourteen 212 | LIEMPTY-1 l i empty one 213 | LIEMPTY l i empty 214 | LIEMBRACE-11 l i embrace eleven 215 | LIEMBRACE l i embrace 216 | LIELEGANT l i elegant 217 | LICOOL l i cool 218 | LICOOKY-1 l i cookie one 219 | LICOMET-1 l i comet one 220 | LICOAX l i coax 221 | LICHEW l i chew 222 | LICHANT-1 l i chant one 223 | LICALLA l i calla 224 | LIBIGHT l i bight 225 | LIANCHOR l i anchor 226 | LI l i 227 | LCPIPIT l c pipit 228 | LCPANGS l c pangs 229 | LCIMPROVE l c improve 230 | LCHARVEST l c harvest 231 | LCFLUTTER l c flutter 232 | LC l c 233 | LAURICLE l a auricle 234 | LAROB l a rob 235 | KUWOLF k u wolf 236 | KUTUBE/D k u tube d 237 | KUTUBE k u tube 238 | KUSODA k u soda 239 | KUROAR k u roar 240 | KURIOT k u riot 241 | KUMONK k u monk 242 | KULOOK k u look 243 | KUJUMP k u jump 244 | KUJAZZ k u jazz 245 | KUHOOK k u hook 246 | KUGOWN k u gown 247 | KUFIRE k u fire 248 | KUDOVE k u dove 249 | KUDESK k u desk 250 | KUCLUB j u club 251 | KUCAGE k u cage 252 | KUBARK k u bark 253 | KU k u 254 | KMPLEBE k m plebe 255 | KMPAJAMA km pajama 256 | KMLASKING k m lasking 257 | KMFORGET k m forget 258 | KMFLUSH k m flush 259 | KLAMBROSIA-29 k l ambrosia twenty nine 260 | KL k l 261 | KEYWAY key wya 262 | KAPOK kay pock 263 | JMZIP j m zip 264 | JMWAVE j m wave 265 | JMTRAV j m trav 266 | JMTIDE j m tide 267 | JMSPUR j m spur 268 | JMRIMM j m rimm 269 | JMPALM j m palm 270 | JMNET j m net 271 | JMMOVE j m move 272 | JMHOPE j m hope 273 | JMHARP j m harp 274 | JMGOLD j m gold 275 | JMGIN j m gin 276 | JMFURY j m fury 277 | JMFIG j m fig 278 | JMDUSK j m dusk 279 | JMCLOSET j m closet 280 | JMCLIPPER j m clipper 281 | JMCLEAR j m clear 282 | JMBLUG j m blug 283 | JMBELL j m bell 284 | JMBAR j m bar 285 | JMATE j m ate 286 | JMASH j m ash 287 | JMARC j m arc 288 | JMADD j m add 289 | JM j m 290 | JKLANCE j k lance 291 | JFK j f k 292 | HYSAGE-1 h y sage one 293 | HTPLUME h t plum 294 | HTLINGUAL h t lingual 295 | HTKEEPER h t keeper 296 | HTBASTE h t baste 297 | HT h t 298 | HBFINCH h b finch 299 | HBEPITOME h b epitome 300 | GYROSE g y rose 301 | GRIP grip 302 | GPPHOTO g p photo 303 | GPLOGIC g p logic 304 | GPIDEAL g p ideal 305 | GPFOCUS g p focus 306 | GPFLOOR g p floor 307 | GPBEFIT g p befit 308 | GPAZURE g p azure 309 | GP g p 310 | GOOSECREEK goose creek 311 | GOLIATH goliath 312 | GFGESTETNER gf gestetner 313 | FJSTEAL f j steal 314 | FJHEARSAY f j hearsay 315 | FJDUST f j dust 316 | EVAL-3 eval three 317 | ESLARD-1 e s lard one 318 | ERYTHROID-3 erythroid three 319 | ERACERB-1 erase r b one 320 | DYVOUR die vore 321 | DTLEAFAGE d t leafage 322 | DTGODOWN d t go down 323 | DTFROGS d t frogs 324 | DTDORIC d t doric 325 | DN d n 326 | DMLIVID d m livid 327 | DM d m 328 | DIZTAG diz tag 329 | DI d i 330 | DAINOLD dane old 331 | cryptonym cryptonym 332 | CITASTE c i taste 333 | CIFENCE-4 c i fence four 334 | CELOTEX-2 see lo tex two 335 | CELOTEX-1 see lo tex one 336 | CARROT carrot 337 | CAPRICE-1 caprice one 338 | CANDI candy 339 | BUTANE butane 340 | BLANKET blanket 341 | BKHERALD b k herald 342 | BKCROWN b k crown 343 | BGGYPSY b g gypsy 344 | BGACTRESS b g actress 345 | BEVISION b e vision 346 | BESMOOTH b e smooth 347 | BE b e 348 | BARR bar 349 | ATTIC attic 350 | ARTICHOKE artichoke 351 | AQUATIC aquatic 352 | ANTLERS antlers 353 | AMYUM-19 a m yum nineteen 354 | AMYUM-1 a m yum one 355 | AMYUM a m yum 356 | AMWORRY-1 a m worry one 357 | AMWORM-1 a m worm one 358 | AMWORLD a m world 359 | AMWOO-1 a m woo one 360 | AMWHIP-1 a m hip one 361 | AMWARM a m warm 362 | AMWAIL-5 a m wail five 363 | AMWAIL-1 a m wail one 364 | AMWAIL a m wail 365 | AMUPAS-1 a m upas one 366 | AMULLA-1 a m ulla one 367 | AMULAR a m ular 368 | AMTURVY-4 a m turvy four 369 | AMTURVY-13 a m turvy thirteen 370 | AMTURVY-1 a m turvy one 371 | AMTURVY a m turvy 372 | AMTRUNK-9 a m trunk nine 373 | AMTRUNK-3 a m trunk three 374 | AMTRUNK-2 a m trunk two 375 | AMTRUNK-11 a m trunk eleven 376 | AMTRUNK-10 a m trunk ten 377 | AMTRUNK-1 a m trunk one 378 | AMTRUNK a m trunk 379 | AMTRIGON-1 a m trigon one 380 | AMTORRID a m torrid 381 | AMTOAD-1 a m toad one 382 | AMTIKI-1 a m tiki one 383 | AMTHUG a m thug 384 | AMTHIGH a m thigh 385 | AMTAUP-2 a m taup two 386 | AMTAUP-10 a m taup ten 387 | AMTAUP-1 a m taup one 388 | AMTABBY-27 a m tabby twenty seven 389 | AMTABBY a m tabby 390 | AMSWIRL-1 a m swirl one 391 | AMSWEEP a m sweep 392 | AMSUPER-1 a m super one 393 | AMSTRUT-2 a m strut two 394 | AMSTRUT a m strut 395 | AMSTOKE-1 a m store one 396 | AMSTET-1 a m stet one 397 | AMSTALK-1 a m stalk one 398 | AMSPILL a m spill 399 | AMSPICE-1 a m spice one 400 | AMSPELL a m spell 401 | AMSOUR-1 a m sour one 402 | AMSOUR a m sour 403 | AMSLOUCH-1 a m soulch one 404 | AMSLAW-1 a m slaw one 405 | AMSIGH-2 a m sigh two 406 | AMSHALE-1 a m shale one 407 | AMSEVER-2 a m sever two 408 | AMSESS-1 a m sess one 409 | AMSERF-1 a m serf one 410 | AMSCROLL a scroll 411 | AMSANTA a m santa 412 | AMSAIL-1 a m sail one 413 | AMRYE-1 a m rye one 414 | AMRUNG-1 a m rung one 415 | AMRUG-5 a m rug five 416 | AMROD a m rod 417 | AMRIPE-3 a m ripe three 418 | AMRIPE-2 a m ripe two 419 | AMRIFT-1 a m rift one 420 | AMRAZZ-1 a m razz one 421 | AMRASP am rasp 422 | AMRANGE a m range 423 | AMQUACK a m quack 424 | AMPUG-1 a m pug one 425 | AMPORT a m port 426 | AMPOON-1 a m poon one 427 | AMPATROL-1 a m patrol one 428 | AMPATROL a m patrol 429 | AMPATRIN a m patrin 430 | AMPARCH-1 a m parch one 431 | AMPANIC-7 a m panic seven 432 | AMPANIC-2 a m panic two 433 | AMPALP-1 a m palp one 434 | AMPALM-5 a m palm five 435 | AMPALM-4 a m palm four 436 | AMPALM-3 a m palm three 437 | AMPALM-26 a m palm twenty six 438 | AMPALM-2 a m palm two 439 | AMPALM-1 a m palm one 440 | AMPALM a m palm 441 | AMPAL-1 a m pal one 442 | AMOURETTE-X a m ooh ret x 443 | AMOURETTE-B a m ooh ret b 444 | AMOURETTE-A a m ooh ret a 445 | AMOURETTE-9 a m ooh ret nine 446 | AMOURETTE-7 a m ooh ret seven 447 | AMOT-99 a m o t ninety nine 448 | AMOT-87 a m o t eighty seven 449 | AMOT-6 a m o t six 450 | AMOT-31 a m o t thirty one 451 | AMOT-3 a m o t three 452 | AMOT-2 a m o t two 453 | AMOT-119 a m o t one nineteen 454 | AMOT a m o t 455 | AMNORM-1 a m norm one 456 | AMNIP-1 a m nip one 457 | AMMUG-1 a m mug one 458 | AMLUNT-2 a m lunt two 459 | AMLUNT-1 a m lunt one 460 | AMLUNCH-1 a m lunch one 461 | AMLOUT-1 a m lout one 462 | AMLOON-1 a m loon one 463 | AMLISP a m lisp 464 | AMLILAC a m lilac 465 | AMLIGHT-1 a m light one 466 | AMLEPTON a m lepton 467 | AMLEO-3 a m leo three 468 | AMLEO a m leo 469 | AMLEG a m leg 470 | AMLAW-3 a m law three 471 | AMLAW-1 a m law one 472 | AMLASH-3 a m lash three 473 | AMLASH-2 a m lash two 474 | AMLASH a m lash 475 | AMLAME-1 a m lame one 476 | AMLACE-1 a m lace one 477 | AMKIRK-1 a m kirk one 478 | AMKHAN-2 a m khan two 479 | AMJUTE-1 a m jute one 480 | AMJAVA-4 a m java four 481 | AMJAG-1 a m jag one 482 | AMJAG a m jag 483 | AMIRON a m iron 484 | AMIRE-1 a m ire one 485 | AMING-4 a m ing four 486 | AMING-3 a m ing three 487 | AMIGGY-1 a m iggy one 488 | AMICE-31 a m ice thirty one 489 | AMICE-27 a m ice twenty seven 490 | AMICE-14 a m ice fourteen 491 | AMICE-1 a m ice one 492 | AMICE a m ice 493 | AMHOBO a m hobo 494 | AMHINT-56 a m hint fifty six 495 | AMHINT-53 a m hint fifty three 496 | AMHINT-5 a m hint five 497 | AMHINT-4 a m hint four 498 | AMHINT-3 a m hint three 499 | AMHINT-26 a m hint twenty six 500 | AMHINT-24 a m hint twenty four 501 | AMHINT-2 a m hint two 502 | AMHINT-1 a m hint one 503 | AMHINT a m hint 504 | AMHIM-2 a m him two 505 | AMHIM a m him 506 | AMHAZE a m haze 507 | AMHAWK-2 a m hawk two 508 | AMHAWK a m hawk 509 | AMHAM-1 a m ham one 510 | AMHALF-2 a m half two 511 | AMHALF a m half 512 | AMGLEN-1 a m glen one 513 | AMGABE-1 a m gabe one 514 | AMFOX-1 a m fox one 515 | AMFAUNA-1 a m fauna one 516 | AMFAUNA a m fauna 517 | AMFAST a m fast 518 | AMEMBER-1 a m ember one 519 | AMEER-1 a m ear 1 520 | AMEER a m ear 521 | AMECRU-1 a m ecrue one 522 | AMDOT a m dot 523 | AMDOFF-1 a m doff one 524 | AMDITTO-23 a m ditto twenty three 525 | AMDIP-3 a m dip three 526 | AMDIP-2 a m dip two 527 | AMDIP-1 a m dip one 528 | AMDESK-1 a m desk one 529 | AMDENIM-4 a m denim four 530 | AMDENIM-14 a m denim fourteen 531 | AMDENIM-11 a m denim eleven 532 | AMDENIM-1 a m denim one 533 | AMCROW-1 a m crow one 534 | AMCROAK-1 a m croak one 535 | AMCRAG-1 a m crag one 536 | AMCOVE-1 a m cove one 537 | AMCOVE a m cove 538 | AMCOUP-1 a m coup one 539 | AMCORE-2 a m core two 540 | AMCORE-1 a m core one 541 | AMCORE a m core 542 | AMCOOP-1 a m coop one 543 | AMCOO a m coo 544 | AMCONCERT-1 a m concert one 545 | AMCOG-5 a m cog five 546 | AMCOG-3 a m cog three 547 | AMCOG-2 a m cog two 548 | AMCOG-1 a m cog one 549 | AMCOG a m cog 550 | AMCOBRA a m cobra 551 | AMCOAX-1 a m coax one 552 | AMCLEVE-15 a m cleave fifteen 553 | AMCLATTER-6 a m clatter six 554 | AMCLATTER-5 a m clatter five 555 | AMCLATTER-4 a m clatter four 556 | AMCLATTER-1 a m clatter one 557 | AMCIGAR a m cigar 558 | AMCHEER-1 a m cheer one 559 | AMCHEER a m cheer 560 | AMCARBON-3 a m carbon three 561 | AMCARBON-2 a m carbon two 562 | AMCARBON-1 a m carbon one 563 | AMCAPE-1 a m cape one 564 | AMCANOE-9 a m canoe nine 565 | AMCANOE-7 a m canoe seven 566 | AMCANOE-3 a m canoe three 567 | AMCANOE-1 a m canoe one 568 | AMCANOE a m canoe 569 | AMCALL-2 a m call two 570 | AMCALL-1 a m call one 571 | AMCALL a m call 572 | AMBUD-1 a m bud one 573 | AMBUD a m bud 574 | AMBRUSH a m brush 575 | AMBRONC-5 a m bronc five 576 | AMBRONC-1 a m bronc one 577 | AMBOAR a m boar 578 | AMBLYGON a m bly gone 579 | AMBLOOD a m blood 580 | AMBLEAK-1 a m bleak one 581 | AMBLAB-1 a m lab one 582 | AMBIDDY-1 a m biddy one 583 | AMBASS-1 a m bass one 584 | AMBARK-1 a m bark one 585 | AMBARB a m barb 586 | AMBANTY-1 a m banty one 587 | AMBANTY a m banty 588 | AMBANG-5 a m bang five 589 | AMBANG-4 a m bang four 590 | AMBANG-3 a m bang three 591 | AMBANG-2 a m bang two 592 | AMBANG-1 a m bang one 593 | AMBANG a m bang 594 | AMAPOLA a m apola 595 | AMAPACHE-2 a m apache two 596 | AM a m 597 | AEOCEAN-3 a e ocean three 598 | AEOCEAN a e ocean 599 | AEMIQUELET-2 a e mee quill ette two 600 | AELADLE a e ladle 601 | AEJAMMER a e jammer 602 | AEGUSTO a e gusto 603 | AEGENERATE a e generate 604 | AEFOXTROT a e foxtrot 605 | AEDONOR a e donor 606 | AEDIPPER-20 ae dipper twenty 607 | AEDINOSAUR a e dinosaur 608 | AEBURBLE a e burble 609 | AEBARMAN a e barman 610 | AE a e 611 | -------------------------------------------------------------------------------- /JFK-Example/speech/questions.txt: -------------------------------------------------------------------------------- 1 | Who was in Kennedy's limousine? 2 | What does GPFLOOR mean? 3 | Who killed Oswald? 4 | What was the Warren Commission? 5 | How was Cuba involved? 6 | -------------------------------------------------------------------------------- /JFK-Example/voice/audio.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/JFK-Example/voice/audio.zip -------------------------------------------------------------------------------- /JFK-Example/voice/transcript.txt: -------------------------------------------------------------------------------- 1 | 00000 Though I haven't heard of that, I've seen the reports on this, on the Senate investigating committee that they've been talking about. 2 | 00001 It'd be very, very bad to have a rash of investigation. 3 | 00002 Yes. 4 | 00003 It'd be a three-ring circus. 5 | 00004 I think he would be a good man. 6 | 00005 He's a good man, but I'm not so certain as to the matter of the publicity that he might seek on it. 7 | 00006 A good man. 8 | 00007 I think so. 9 | 00008 Be an excellent man. 10 | 00010 That's right. 11 | 00011 I know of him but I don't know him. 12 | 00012 I saw him on TV the other night for the first time; he handled himself well on that. 13 | 00013 Oh yes I know. 14 | 00014 Yes, I know him. 15 | 00015 Well, that's mighty nice of you, Mister President. 16 | 00016 We'll be. 17 | 00017 We hope to have this thing wrapped up today. 18 | 00018 We probably won't get it before the first of the week. 19 | 00019 This angle in Mexico is giving us a great deal of trouble. 20 | 00020 Because the stories, they have this man, Oswald, getting sixty five hundred dollars from the Cuban embassy. 21 | 00021 Coming back to this country with it. 22 | 00022 We're not able to prove that fact. 23 | 00023 The information was that he was there on the eighteenth. 24 | 00024 We are able to prove conclusively he was in New Orleans that day. 25 | 00025 The story came in changing the date to the tewnty eighth of September. 26 | 00026 The Mexican police have again arrested this woman, Duran. 27 | 00027 They'll hold her for two or three more days. 28 | 00028 We're going to confront her with the original informant. 29 | 00029 And we're also going to put the lie detector test on him. 30 | 00030 Meantime of course Castro's hollering his head off. 31 | 00031 I would not pay one hundred per cent attention to them. 32 | 00032 All that they are is a psychological asset in an investigation. 33 | 00033 I wouldn't want to be a part to sending a man to the chair on a lie detector. 34 | 00034 For instance, we have found many cases where we've used 'em in a bank where there has been embezzlement, and a person will confess before the lie detector test is finished. 35 | 00035 More or less fearful of the fact that the lie detector test will show them guilty. 36 | 00036 Psychologically, the have that advantage. 37 | 00037 It's a misnomer to call it a lie detector. 38 | 00038 What it really is is the evaluation of a chart that is made by this machine. 39 | 00039 And that evaluation is made by a human being. 40 | 00040 And any human being can be apt to make a wrong interpretation. 41 | 00041 So I would not myself go on that alone. 42 | 00042 There's no question but that he is the man. 43 | 00043 The fingerprints and things that we have. 44 | 00044 This fellow Rubenstein down there, he has offered to take the lie detector test, but his lawyer has got to be, of course, consulted first, and I doubt whether the lawyer will allow it. 45 | 00045 He's one of those criminal lawyers from the west coast. 46 | 00046 Somewhat like a Edward Bennett Williams type, and almost as much of a shyster. 47 | 00047 At the present time we have not. 48 | 00048 This fellow had been in this night club, this strip tease joint that he had, but that has not been able to be confirmed. 49 | 00049 This fellow Rubenstein is a very shady character, has a bad record, street brawler, fighter, and that sort of thing. 50 | 00050 In the place in Dallas, if a fellow came in there and couldn't pay his bill completely, Rubenstein would beat the very devil out of him and then throw him out of the place. 51 | 00051 He was that kind of a fellow. 52 | 00052 He didn't drink, didn't smoke, boasted about that. 53 | 00053 He is what I would put in the category, one of those egomaniacs. 54 | 00054 He likes to be in the limelight. 55 | 00055 He knew all the police in the white light district where the joints are down there. 56 | 00056 And he also let 'em come in, see the show, get food, and get liquor, and so forth. 57 | 00057 That's how I think ge got into police headquarters. 58 | 00058 They accepted him as kind of a police character hanging around police headquarters. 59 | 00059 Of course, they never made any moves, as the pictures show, even when they saw him approaching. 60 | 00060 Got up right to him and pressed his pistol against Oswald's stomach. 61 | 00061 Neither of the police officers on either side made any move to push him away or to grab him. 62 | 00062 Wasn't until after the gun was fired that they then moved. 63 | 00063 Secondly, the Chief of Police admits that he moved him in the morning as a convenience and at the request of a motion picture people who wanted to have daylight. 64 | 00064 Now of course that is not the highest degree of efficiency, certainly to say. 65 | 00065 He should have moved him at night. 66 | 00066 And those derelictions in that phase. 67 | 00067 But so far as tying Rubenstein and Oswald together, we haven't as yet done so. 68 | 00068 But then a number of stories come in. 69 | 00069 We have tied Oswald into the Civil Liberties Union in New York, membership into that. 70 | 00070 And in course into this Cuban Fair Play Commission - Committee - which is pro-Castro and dominated by Communism, and financed to some extent by the Castro government. 71 | 00071 Two of the shots fired at the President were splintered, but they had characteristics on 'em so that our ballistic expert was able to prove that they were fired by this gun. 72 | 00072 He was hit by the first and the third. 73 | 00073 The second shot hit the governor. 74 | 00074 The third shot is a completely, is a complete bullet that wasn't shattered, and that rolled out of the President's head and tore a large part of the President's head off. 75 | 00075 In trying to massage his heart, at the, on the, at the hospital, on the way to the hospital, they apparently loosened that, and that fell onto the stretcher. 76 | 00076 We recovered that, and we have that. 77 | 00077 We have the gun here also. 78 | 00078 They were aiming directly at the President. 79 | 00079 There's no question about that. 80 | 00080 This telescopic lens, which I've looked through, it brings a person as close to you as if they were sittin' right beside you. 81 | 00081 We also have tested the fact that you could fire those three shots were fired within three seconds. 82 | 00082 There's been some stories going around in the papers and so forth that must have been more than one man because no one man could fire those shots in the time that they were fired. 83 | 00083 We've just proved that by the actual test that we've made. 84 | 00084 Connally turned to the President as the, when the first shot was fired. 85 | 00085 And I think in that, in that turning, it was where he got hit. 86 | 00086 I think that's very likely. 87 | 00087 No, the President wasn't hit with the second one. 88 | 00088 The president no doubt would have been hit. 89 | 00089 He would been hit three times. 90 | 00090 On the fifth floor of that building where we found the gun, and the wrapping paper in which the gun was wrapped, had been wrapped, and upon which we find the full fingerprints of this man Oswald, on that floor we found the three empty shells that had been fired, and one shell that had not been fired. 91 | 00091 Other words there were four shells, apparently, and he had, he had fired three, but didn't fire the fourth one. 92 | 00092 He then threw the gun aside and came down and, at the, at the entrance of the building, he was stopped by a police officer, and some worker, some manager in the building, told the police officer well he's all right, he works here. 93 | 00093 You needn't hold him. 94 | 00094 So they let him go. 95 | 00095 That's how he got out. 96 | 00096 And then he got on a bus. 97 | 00097 The bus driver has identified him. 98 | 00098 And went out to his home. 99 | 00099 Got hold of a jacket. 100 | 00100 Then came back downtown. 101 | 00101 Walking downtown. 102 | 00102 The police officer who was killed stopped him, not knowing who he was or not whether he was the man, but they were, just on suspicion, and he fired of course and killed the police officer. 103 | 00103 Oh yes, we can prove that. 104 | 00104 The he walked about another two blocks and went to the theater. 105 | 00105 And the woman at the theater window, selling the tickets, she was so suspicious, the way he was acting, and she said he was carrying a gun, he had a revolver at that time, with which he had killed the police officer. 106 | 00106 He went into the theater, and she notified the police. 107 | 00107 The police, and our man down there, went in there and located this particular man. 108 | 00108 We had quite a struggle with him, he fought like a, like a lion. 109 | 00109 He had to be subdued, of course. 110 | 00110 Was then brought out and of course taken to the police headquarters. 111 | 00111 He apparently had come down the flve flights of steps, a stairway from the fifth floor. 112 | 00112 So far as we've found out, the elevator was not used, although he could have used it, but nobody remembers whether it was or whether it wasn't. 113 | 00113 I tihnk that's correct. 114 | 00114 That's what we're trying to nail down now. 115 | 00115 He was strogly pro-Castro. 116 | 00116 He was strongly anti-American. 117 | 00117 He had been in correspondence, which we have, with the Soviet embassy here in Washington, and with the American Civil Liberties Union, and with this Committee for Fair Play to Cuba. 118 | 00118 We have copies of the correspondence. 119 | 00119 We've got him nailed down in, in his contact with them. 120 | 00120 None of those letters, however, dealt with any indication of violence. 121 | 00121 Or contemplated assassination. 122 | 00122 They were dealing with the matter of a visa for wis wife to go back to Russia. 123 | 00123 Now there's one angle of this thing that I'm hopeful to get some word on today. 124 | 00124 This woman, his wife, has been very hostile. 125 | 00125 She would not cooperate. 126 | 00126 She speaks Russian and Russian only. 127 | 00127 She did say to us yesterday down there that if we could give her assurance that she would be allowed in this country, she might cooperate. 128 | 00128 I told our agents down there to give her that assurance. 129 | 00129 She could stay in this country. 130 | 00130 I sent a Russian-speaking agent into Dalles last night to interview her. 131 | 00131 We've got her now. 132 | 00132 He had access on all floors. 133 | 00133 Didn't have particular office. 134 | 00134 Orders came in for certain books, and some books would be on the first floor, second floor, third floor, and so forth. 135 | 00135 No particular place that he was stationed, at all. 136 | 00136 He was just a general packer of the requisitions that came in for school books from the, from the Dallas schools. 137 | 00137 Therefore he had access, perfectly proper access, to the fifth floor and the sixth floor. 138 | 00138 Usually, most of the employees were down on lower floors. 139 | 00139 He was seen on the fifth floor by one of the workmen. 140 | 00140 He was seen there. 141 | 00141 Taken of the parade and showing Missus Kennedy climibing out of the back seat. 142 | 00142 There was no Secret Service man standing on the back of the car. 143 | 00143 Usually the Presidential car, in the past, has had steps on the back next to the bumpers, and there's usually been one on either side standing on those steps, that the, at the back bumper. 144 | 00144 Whether the President asked that that not be done, we don't know. 145 | 00145 The bubble top was not up. 146 | 00146 But the bubble top wasn't worth a damn anyway 'cause it made entirely of, of, of plastic. 147 | 00147 Much to my surprise, the Secret Service do not have any armored cars. 148 | 00148 Oh yes, I do. 149 | 00149 I think you most certainly should have one. 150 | 00150 Most certainly should. 151 | 00151 We have one in New York. 152 | 00152 We use it for, for different purposes. 153 | 00153 I use it here for myself. 154 | 00154 And if we have any raids to make, or have to surround a place where anybody's hidden in, we use the bulletproof car on that. 155 | 00155 But it means that the top has to remain up. 156 | 00156 Cause you can bulletproof the entire car including the glass. 157 | 00157 You could never let the top down. 158 | 00158 But I do think you ought to have a bulletproof car. 159 | 00159 I was surprised the other day when I made inquiry. 160 | 00160 All that I understand the Secret Service has had, has had two cars metal plates underneath the car. 161 | 00161 To take care of a hand grenade or a bomb that might be thrown out and roll along the street. 162 | 00162 Well, of course, wo don't do those things in this country. 163 | 00163 In Europe, that's the way they assassinate the heads of state, with bombs. 164 | 00164 They've been after General De Gaulle, you know, with that sort of thing. 165 | 00165 But in this country, all our assassinations have been with guns. 166 | 00166 Very definitely, I was very much surprised when I learned that this bubble top thing was not bulletproof in any respect. 167 | 00167 The plastic top to it was down, of course; the President had insisted upon that, so that he could stand up and wave to the crowd. 168 | 00168 It seems to me that the President ought to always be in a bulletproof car. 169 | 00169 It certianly would prevent anything like this ever happening again. 170 | 00170 You could have a thousand Secret Service men on guard, and still a sniper can snipe you from up in the window, if you are exposed like the President was. 171 | 00171 But he can't do it if you have a, have a solid top bulletproof top to it. 172 | 00172 As it should be. 173 | 00173 Well I would certainly think so, Mister President. 174 | 00174 I think it ought to be done very quietly. 175 | 00175 There's a concern that's out I think in Cincinnati where we have our cars bulletproofed. 176 | 00176 I think we've got four. We've gon one on the west coast, one in New York, and one here. 177 | 00177 I think it can be done quietly, without any publicity being given to it, or any pictures being taken of it, if it's handled properly. 178 | 00178 But I think you ought to have the cars on that ranch there. It's perfectly easy for somebody to get onto the rach. 179 | 00179 By all means. 180 | 00180 You've got to really almost be in the capacity of a so-called prisoner. 181 | 00181 Because without that security, anything can be done. 182 | 00182 Now we've got a lot of letters and phone calls over the last three or four or five days. 183 | 00183 Got one about this parade the other day. 184 | 00184 They were going to try to kill you then. 185 | 00185 I talked with the Attorney General about it. 186 | 00186 I was very much opposed to that marching. 187 | 00187 That's what Bobby told me. 188 | 00188 When I heard of it, I talked with the Secret Service and they were very much opposed to it. 189 | 00189 I was very much opposed to it because it was even worse than down there in Dallas. 190 | 00190 Somebody on the sidewalk could dash out. 191 | 00191 While they had police assigned along the curbstone looking at the crowd, when the parade came along the police turned around and looked at the parade! 192 | 00192 I'll be very glad to indeed. 193 | 00193 On the other hand, if this fellow Oswald had lived, and had taken the lie detector test, and it had shown definitely that he had done these various things, together with the evidence that we very definitely have, it would have just added that, that much more strength to it. 194 | 00194 But he didn't. 195 | 00195 I'm not as enthusiastic about McCloy. -------------------------------------------------------------------------------- /JFK-Example/wwwroot1/bot.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 59 | 60 | 61 |
62 |
Ask J. Edgar Hoover
63 |
64 | 65 |
66 | 67 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /JFK-Example/wwwroot1/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | Ask J. Edgar Hoover @ The JFK Files 16 | 17 | 94 | 95 | 96 | 97 |
98 | 99 |
100 | 101 |
102 | 103 |
104 |
105 | 106 |
107 |
108 |
109 | 110 |
111 | 112 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /JFK-Example/wwwroot1/footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/JFK-Example/wwwroot1/footer.png -------------------------------------------------------------------------------- /JFK-Example/wwwroot1/hoover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/JFK-Example/wwwroot1/hoover.jpg -------------------------------------------------------------------------------- /JFK-Example/wwwroot1/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/JFK-Example/wwwroot1/icon.png -------------------------------------------------------------------------------- /JFK-Example/wwwroot1/settings.js: -------------------------------------------------------------------------------- 1 | // Bot settings 2 | const botSecret = "from the Direct Line channel in the Channels blade of your Web App Bot"; 3 | 4 | // Speech settings 5 | const speechKey = "from the Keys blade of your Speech Service instance in the Azure portal"; 6 | const speechRegion = "westus"; 7 | const speechRecognitionEndpoint = "10-minute wss URL from the Endpoints page of the Custom Speech portal"; 8 | const speechSynthesisEndpoint = "from the Endpoints page of the Custom Voice portal"; 9 | const tokenEndpoint = "https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken"; 10 | -------------------------------------------------------------------------------- /JFK-Example/wwwroot1/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/JFK-Example/wwwroot1/title.png -------------------------------------------------------------------------------- /JFK-Example/wwwroot2/bot.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 60 | 61 | 62 |
63 |
Ask J. Edgar Hoover
64 |
65 | 66 |
67 | 68 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /JFK-Example/wwwroot3/bot.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 59 | 60 | 61 |
62 |
Ask J. Edgar Hoover
63 |
64 |
65 | 66 |
67 | 68 | 69 | 270 | 271 | 272 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | This repo contains the walk through for a 2 hour tutorial on adding speech to bots. 3 | 4 | In this tutorial we will walk you through two scenarios for integrating speech to text (STT) and text to speech (TTS) capabilities. 5 | 6 | The first scenario is based on the [JFK Hoover Bot](https://github.com/Azure-Samples/jfkfileshooverbot) and will showcase how you integrate STT and TTS capabilities into a web app. You will also learn about integrating a custom voice. 7 | 8 | The Hoover Bot is a single-page Web app that works in any modern browser and provides a conversational interface to The JFK Files. The JFK Files is a Web app that lets you search a corpus of documents related to the assassination of President John F. Kennedy on November 22, 1963, released by the United States government. Microsoft has presented this technology demonstration, which showcases the power of Azure Cognitive Search, on several occasions. 9 | 10 | The second scenario is based on the [Study Bot](https://github.com/Azure-Samples/cognitive-services-studybot-csharp 11 | ) sample which showcases how to integrate STT capabilities into a C# UWP application. This application, lets users learn study terms in three subjects: Geology, Biology and Sociology through a conversational experience. The goal is to enable a more engaging study epxerience. 12 | 13 | ## Prerequisites 14 | 15 | 1. [Azure Account](http://portal.azure.com/) 16 | 17 | 1. [Visual Studio 2017+](https://www.visualstudio.com/downloads) 18 | 19 | 1. [Bot Framework Emulator](https://aka.ms/Emulator-wiki-getting-started) 20 | 21 | 1. Install and configure [ngrok](https://github.com/Microsoft/BotFramework-Emulator/wiki/Tunneling-%28ngrok%29). Ngrok has a free version and you don't need to create an account, just download it. If Ngrok is not configured, you'll see a link in your emulator where you can click to configure (edit) it. 22 | 23 | 1. [msbot](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/MSBot) and [Dipatch](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/Dispatch) CLI tools 24 | 25 | 1. Knowledge of [.bot](https://docs.microsoft.com/en-us/azure/bot-service/bot-file-basics?view=azure-bot-service-4.0) files 26 | 27 | 1. Knowledge of [ASP.Net](https://docs.microsoft.com/aspnet/core/) Core and asynchronous programming in C# 28 | 29 | 1. For the JFK Hoover bot, you will need access to an instance of the [JFK Files demo](https://github.com/Microsoft/AzureSearch_JFK_Files) and [Custom Voice Model](http://cris.ai/). You can either configure your own or ask your facilitator for the keys. 30 | 31 | 32 | ## Tutorial Steps 33 | Work through the following README files: 34 | 35 | 1. [JFK Hoover Bot](./JFK-Example/README.md) 36 | 37 | 1. [Study Bot](./Study-bot-example/README.md) 38 | 39 | ## Further reading and Documentation 40 | 41 | - [Bot Framework Documentation](https://docs.botframework.com) 42 | - [Bot basics](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-basics?view=azure-bot-service-4.0) 43 | - [Azure Bot Service Introduction](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-overview-introduction?view=azure-bot-service-4.0) 44 | - The [14.nlp-with-dispatch](https://github.com/Microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/14.nlp-with-dispatch) sample. The Qna-Luis-Botv4 sample is largely based on this sample. 45 | - [LUIS](https://luis.ai) 46 | - [QnA Maker](https://qnamaker.ai) 47 | - [QnA Maker Dcoumentation](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/index) 48 | - [Activity processing](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-concept-activity-processing?view=azure-bot-service-4.0) 49 | - [Prompt Types](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-prompts?view=azure-bot-service-4.0&) 50 | - [Channels and Bot Connector Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-concepts?view=azure-bot-service-4.0) 51 | - [Channels and Bot Connector Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-concepts?view=azure-bot-service-4.0) 52 | - [QnA Maker API V4.0](https://westus.dev.cognitive.microsoft.com/docs/services/5a93fcf85b4ccd136866eb37/operations/5ac266295b4ccd1554da75ff) 53 | - [Add Chit-chat to a QnA Maker knowledge base](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base) 54 | - [Language Understanding (LUIS) Documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/) 55 | - [LUIS Programmatic APIs v2.0](https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5890b47c39e2bb052c5b9c2f) 56 | - [LUIS Endpoint API](https://westus.dev.cognitive.microsoft.com/docs/services/5819c76f40a6350ce09de1ac/operations/5819c77140a63516d81aee78) 57 | - [Bing Spell Check API Documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-spell-check/) 58 | - [Bing Spell Check API v7 reference](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-spell-check-api-v7-reference) 59 | - [Integrating QnA Maker and LUIS bot v4 tutorial, using Dispatch](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=csharp) 60 | - [Speech Services Documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/) 61 | -------------------------------------------------------------------------------- /Study-bot-example/Qna-Luis-Bot-v4/BotServices.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using Microsoft.ApplicationInsights; 7 | using Microsoft.Bot.Builder.AI.Luis; 8 | using Microsoft.Bot.Builder.AI.QnA; 9 | using Microsoft.Bot.Configuration; 10 | 11 | namespace Microsoft.BotBuilderSamples 12 | { 13 | /// 14 | /// Represents the bot's references to external services. 15 | /// 16 | /// For example, Application Insights, Luis models and QnaMaker services 17 | /// are kept here (singletons). These external services are configured 18 | /// using the BotConfigure class (based on the contents of your ".bot" file). 19 | /// 20 | public class BotServices 21 | { 22 | /// 23 | /// Initializes a new instance of the class. 24 | /// 25 | /// An Application Insights instance. 26 | /// A dictionary of named instances for usage within the bot. 27 | public BotServices(Dictionary qnaServices, Dictionary luisServices) 28 | { 29 | QnAServices = qnaServices ?? throw new ArgumentNullException(nameof(qnaServices)); 30 | LuisServices = luisServices ?? throw new ArgumentNullException(nameof(luisServices)); 31 | } 32 | 33 | /// 34 | /// Gets the (potential) set of QnA Services used. 35 | /// Given there can be multiple QnA services used in a single bot, 36 | /// QnA is represented as a Dictionary. This is also modeled in the 37 | /// ".bot" file since the elements are named (string). 38 | /// This sample only uses a single QnA instance. 39 | /// 40 | /// 41 | /// A QnAMaker client instance created based on configuration in the .bot file. 42 | /// 43 | public Dictionary QnAServices { get; } = new Dictionary(); 44 | 45 | /// 46 | /// Gets the (potential) set of Luis Services used. 47 | /// Given there can be multiple Luis services used in a single bot, 48 | /// LuisServices is represented as a Dictionary. This is also modeled in the 49 | /// ".bot" file since the elements are named (string). 50 | /// This sample only uses a single Luis instance. 51 | /// 52 | /// 53 | /// A client instance created based on configuration in the .bot file. 54 | /// 55 | public Dictionary LuisServices { get; } = new Dictionary(); 56 | } 57 | } -------------------------------------------------------------------------------- /Study-bot-example/Qna-Luis-Bot-v4/FAQs/StudyBiology.tsv: -------------------------------------------------------------------------------- 1 | Question Answer Source Metadata 2 | Biology Let's study biology! Type in what you want to study, and a definition will be returned. For example, type "virus". StudyBiology.txt 3 | bio Let's study biology! Type in what you want to study, and a definition will be returned. For example, type "virus". StudyBiology.txt 4 | time for biology Let's study biology! Type in what you want to study, and a definition will be returned. For example, type "virus". StudyBiology.txt 5 | let's study biology Let's study biology! Type in what you want to study, and a definition will be returned. For example, type "virus". StudyBiology.txt 6 | study biology Let's study biology! Type in what you want to study, and a definition will be returned. For example, type "virus". StudyBiology.txt 7 | What is a virus? A virus is an infective agent that typically consists of a nucleic acid molecule in a protein coat, is too small to be seen by light microscopy, and can multiply only within the living cells of a host. StudyBiology.txt 8 | bug\n A virus is an infective agent that typically consists of a nucleic acid molecule in a protein coat, is too small to be seen by light microscopy, and can multiply only within the living cells of a host. StudyBiology.txt 9 | What are bacteria? Bacteria are a group of microorganisms that can live in soil, water, or parasites of plants or animals. StudyBiology.txt 10 | bug Bacteria are a group of microorganisms that can live in soil, water, or parasites of plants or animals. StudyBiology.txt 11 | What is a parasite? A parasite is an organism that lives in or on an organism of another species (its host) and benefits by deriving nutrients at the other's expense. StudyBiology.txt 12 | bug A parasite is an organism that lives in or on an organism of another species (its host) and benefits by deriving nutrients at the other's expense. StudyBiology.txt 13 | What is asexual reproduction? Sexual reproduction is the creation of genetically identical offspring by a single parent. StudyBiology.txt 14 | sex Sexual reproduction is the creation of genetically identical offspring by a single parent. StudyBiology.txt 15 | asexual Sexual reproduction is the creation of genetically identical offspring by a single parent. StudyBiology.txt 16 | asexual reproduction Sexual reproduction is the creation of genetically identical offspring by a single parent. StudyBiology.txt 17 | reproduction Sexual reproduction is the creation of genetically identical offspring by a single parent. StudyBiology.txt 18 | What is sexual reproduction? Sexual reproduction is a process by which two individuals produce offspring with genetic traits from both parents. It involves the union of gametes. StudyBiology.txt 19 | sex Sexual reproduction is a process by which two individuals produce offspring with genetic traits from both parents. It involves the union of gametes. StudyBiology.txt 20 | sexual reproduction Sexual reproduction is a process by which two individuals produce offspring with genetic traits from both parents. It involves the union of gametes. StudyBiology.txt 21 | sexual Sexual reproduction is a process by which two individuals produce offspring with genetic traits from both parents. It involves the union of gametes. StudyBiology.txt 22 | reproduction Sexual reproduction is a process by which two individuals produce offspring with genetic traits from both parents. It involves the union of gametes. StudyBiology.txt 23 | What is cancer? Cancer is a malignant growth or tumor caused by abnormal and uncontrolled cell division. StudyBiology.txt 24 | tumor Cancer is a malignant growth or tumor caused by abnormal and uncontrolled cell division. StudyBiology.txt 25 | What is the blood brain barrier? The blood brain barrier is a filtering mechanism of the capillaries that carry blood to the brain and spinal cord tissue, blocking the passage of certain substances. StudyBiology.txt 26 | blood brain The blood brain barrier is a filtering mechanism of the capillaries that carry blood to the brain and spinal cord tissue, blocking the passage of certain substances. StudyBiology.txt 27 | blood brain barrier The blood brain barrier is a filtering mechanism of the capillaries that carry blood to the brain and spinal cord tissue, blocking the passage of certain substances. StudyBiology.txt 28 | blood The blood brain barrier is a filtering mechanism of the capillaries that carry blood to the brain and spinal cord tissue, blocking the passage of certain substances. StudyBiology.txt 29 | brain The blood brain barrier is a filtering mechanism of the capillaries that carry blood to the brain and spinal cord tissue, blocking the passage of certain substances. StudyBiology.txt -------------------------------------------------------------------------------- /Study-bot-example/Qna-Luis-Bot-v4/FAQs/StudyGeology.tsv: -------------------------------------------------------------------------------- 1 | Question Answer Source Metadata 2 | What is magnitude? Magnitude is the strength of an earthquake. Study Geology.tsv 3 | magnitude Magnitude is the strength of an earthquake. Study Geology.tsv 4 | What is magma? Magma, also known as lava, is molten rock that triggers earthquakes and creates volcanoes as it rises within the Earth. Study Geology.tsv 5 | rising lava Magma, also known as lava, is molten rock that triggers earthquakes and creates volcanoes as it rises within the Earth. Study Geology.tsv 6 | lava Magma, also known as lava, is molten rock that triggers earthquakes and creates volcanoes as it rises within the Earth. Study Geology.tsv 7 | What is a metamorphic rock? A metamorphic rock is a rock formed when another rock is changed by extreme heat or pressure. Study Geology.tsv 8 | pressured rock A metamorphic rock is a rock formed when another rock is changed by extreme heat or pressure. Study Geology.tsv 9 | metamorphic A metamorphic rock is a rock formed when another rock is changed by extreme heat or pressure. Study Geology.tsv 10 | What is an epoch? An epoch is a subdivision of a period. Study Geology.tsv 11 | time An epoch is a subdivision of a period. Study Geology.tsv 12 | epoch An epoch is a subdivision of a period. Study Geology.tsv 13 | What is an era? An era is a subdivision of the geologic time scale. Study Geology.tsv 14 | time An era is a subdivision of the geologic time scale. Study Geology.tsv 15 | era An era is a subdivision of the geologic time scale. Study Geology.tsv 16 | What is a period? A period is a subdivision of an era. Study Geology.tsv 17 | time A period is a subdivision of an era. Study Geology.tsv 18 | period A period is a subdivision of an era. Study Geology.tsv 19 | geology Let's study geology! Type in a geology word(s) and a definition will be returned. For example, type "lava". Study Geology.tsv 20 | let's study geology Let's study geology! Type in a geology word(s) and a definition will be returned. For example, type "lava". Study Geology.tsv 21 | time for geology Let's study geology! Type in a geology word(s) and a definition will be returned. For example, type "lava". Study Geology.tsv 22 | i want to study geology Let's study geology! Type in a geology word(s) and a definition will be returned. For example, type "lava". Study Geology.tsv 23 | study geology Let's study geology! Type in a geology word(s) and a definition will be returned. For example, type "lava". Study Geology.tsv 24 | geo Let's study geology! Type in a geology word(s) and a definition will be returned. For example, type "lava". Study Geology.tsv -------------------------------------------------------------------------------- /Study-bot-example/Qna-Luis-Bot-v4/FAQs/StudySociology.tsv: -------------------------------------------------------------------------------- 1 | Question Answer Source Metadata 2 | What is absolute poverty? Absolute poverty is the condition of having too little income to buy the necessities-- food, shelter, clothing, health care. Study Sociology.tsv 3 | Poverty Absolute poverty is the condition of having too little income to buy the necessities-- food, shelter, clothing, health care. Study Sociology.tsv 4 | What is affirmative action? Affirmative action is the requirement that employers make special efforts to recruits hire and promote qualified members of previously excluded groups including women and minorities. Study Sociology.tsv 5 | Equal rights Affirmative action is the requirement that employers make special efforts to recruits hire and promote qualified members of previously excluded groups including women and minorities. Study Sociology.tsv 6 | What is alienation? Alienation is the separation or estrangement of individuals from themselves and from others. Study Sociology.tsv 7 | alienated Alienation is the separation or estrangement of individuals from themselves and from others. Study Sociology.tsv 8 | What is Apartheid? Apartheid is the recent policy of racial separation in South Africa enforced by legal political and military power. Study Sociology.tsv 9 | South Africa Apartheid is the recent policy of racial separation in South Africa enforced by legal political and military power. Study Sociology.tsv 10 | Apartheid Apartheid is the recent policy of racial separation in South Africa enforced by legal political and military power. Study Sociology.tsv 11 | What is bicultural? Bicultural is the capacity to understand and function well in more than one cultural group. Study Sociology.tsv 12 | Two cultures Bicultural is the capacity to understand and function well in more than one cultural group. Study Sociology.tsv 13 | 2 cultures Bicultural is the capacity to understand and function well in more than one cultural group. Study Sociology.tsv 14 | sociology Let's study sociology! Type in a sociology word(s), and a definition will be returned. For example, type "absolute poverty". Study Sociology.tsv 15 | let's study sociology Let's study sociology! Type in a sociology word(s), and a definition will be returned. For example, type "absolute poverty". Study Sociology.tsv 16 | time for sociology Let's study sociology! Type in a sociology word(s), and a definition will be returned. For example, type "absolute poverty". Study Sociology.tsv 17 | next up, sociology Let's study sociology! Type in a sociology word(s), and a definition will be returned. For example, type "absolute poverty". Study Sociology.tsv 18 | study sociology Let's study sociology! Type in a sociology word(s), and a definition will be returned. For example, type "absolute poverty". Study Sociology.tsv 19 | i want to study sociology Let's study sociology! Type in a sociology word(s), and a definition will be returned. For example, type "absolute poverty". Study Sociology.tsv 20 | What is a minority? Minorities are people who possess some distinctive physical or cultural characteristics, are dominated by the majority, and are denied equal treatment. Study Sociology.tsv 21 | minority Minorities are people who possess some distinctive physical or cultural characteristics, are dominated by the majority, and are denied equal treatment. Study Sociology.tsv 22 | What is cultural pluralism? Cultural pluralism is a pattern of assimilation where immigrants are allowed to maintain their traditional cultural ways while at the same time learning the values and norms of the host culture. Study Sociology.tsv 23 | What is a stereotype? A stereotype is an over-generalized belief about a category of people. Stereotyping is, for example, believing that "all politicians are corrupt". Study Sociology.tsv -------------------------------------------------------------------------------- /Study-bot-example/Qna-Luis-Bot-v4/NlpDispatchBot.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // See https://github.com/microsoft/botbuilder-samples for a more comprehensive list of samples. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Diagnostics; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Threading; 11 | using System.Threading.Tasks; 12 | using Microsoft.Bot.Builder; 13 | using Microsoft.Bot.Builder.AI.Luis; 14 | using Microsoft.Bot.Schema; 15 | using Newtonsoft.Json; 16 | 17 | namespace Microsoft.BotBuilderSamples 18 | { 19 | /// 20 | /// Main entry point and orchestration for bot. 21 | /// 22 | public class NlpDispatchBot : IBot 23 | { 24 | /// 25 | /// Key in the Bot config (.bot file) for the Dispatch. 26 | /// If you have entities in your LUIS app, you will want to create a separate LUIS app for those 27 | /// that will act as a model for the Dispatch app. Here the Dispatch app is used directly. 28 | /// 29 | public static readonly string DispatchKey = "Qna-Luis-Botv4-Dispatch"; 30 | 31 | /// 32 | /// Key in the Bot config (.bot file) for the QnaMaker instance(s). 33 | /// In the .bot file, multiple instances of QnaMaker can be configured. 34 | /// 35 | public static readonly string QnAMakerChitchat = "Chitchat"; 36 | public static readonly string QnAMakerBiology = "StudyBiology"; 37 | public static readonly string QnAMakerSociology = "StudySociology"; 38 | public static readonly string QnAMakerGeology = "StudyGeology"; 39 | 40 | // Optional 41 | private const string WelcomeText = "Welcome to Study Bot!"; 42 | 43 | /// 44 | /// Services configured from the ".bot" file. 45 | /// 46 | private readonly BotServices _services; 47 | 48 | /// 49 | /// Initializes a new instance of the class. 50 | /// 51 | /// Services configured from the ".bot" file. 52 | public NlpDispatchBot(BotServices services) 53 | { 54 | _services = services ?? throw new ArgumentNullException(nameof(services)); 55 | 56 | // Verify Qna Maker Chitchat-Shell knowledge base configuration 57 | if (!_services.QnAServices.ContainsKey(QnAMakerChitchat)) 58 | { 59 | throw new InvalidOperationException($"Invalid configuration. Please check your '.bot' file for a QnA service named `{QnAMakerChitchat}`."); 60 | } 61 | 62 | // Verify Qna Maker StudyBiology knowledge base configuration 63 | if (!_services.QnAServices.ContainsKey(QnAMakerBiology)) 64 | { 65 | throw new InvalidOperationException($"Invalid configuration. Please check your '.bot' file for a QnA service named `{QnAMakerBiology}`."); 66 | } 67 | 68 | // Verify Qna Maker StudySociology knowledge base configuration 69 | if (!_services.QnAServices.ContainsKey(QnAMakerSociology)) 70 | { 71 | throw new InvalidOperationException($"Invalid configuration. Please check your '.bot' file for a QnA service named `{QnAMakerSociology}`."); 72 | } 73 | 74 | // Verify Qna Maker StudyGeology knowledge base configuration 75 | if (!_services.QnAServices.ContainsKey(QnAMakerGeology)) 76 | { 77 | throw new InvalidOperationException($"Invalid configuration. Please check your '.bot' file for a QnA service named `{QnAMakerGeology}`."); 78 | } 79 | } 80 | 81 | /// 82 | /// Run every turn of the conversation. Handles orchestration of messages. 83 | /// 84 | /// Bot Turn Context. 85 | /// Task CancellationToken. 86 | /// A representing the asynchronous operation. 87 | public async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken)) 88 | { 89 | var activity = turnContext.Activity; 90 | 91 | if (activity.Type == ActivityTypes.Message && !turnContext.Responded) 92 | { 93 | // Perform a call to LUIS to retrieve results for the current activity message. 94 | var luisResults = await _services.LuisServices[DispatchKey].RecognizeAsync(turnContext, cancellationToken); 95 | 96 | var topIntent = luisResults?.GetTopScoringIntent(); 97 | 98 | if (topIntent == null) 99 | { 100 | await turnContext.SendActivityAsync("Unable to get the top intent."); 101 | } 102 | else 103 | { 104 | await DispatchToTopIntentAsync(turnContext, topIntent, cancellationToken); 105 | } 106 | } 107 | else if (turnContext.Activity.Type == ActivityTypes.ConversationUpdate) 108 | { 109 | // Send a welcome message to the user and tell them what actions they may perform to use this bot 110 | await SendWelcomeMessageAsync(turnContext, cancellationToken); 111 | } 112 | else 113 | { 114 | await turnContext.SendActivityAsync($"{turnContext.Activity.Type} event detected", cancellationToken: cancellationToken); 115 | } 116 | } 117 | 118 | /// 119 | /// Depending on the intent from Dispatch, routes to the right LUIS model or QnA service. 120 | /// 121 | private async Task DispatchToTopIntentAsync(ITurnContext context, (string intent, double score)? topIntent, CancellationToken cancellationToken = default(CancellationToken)) 122 | { 123 | const string chitchatDispatchKey = "q_Chitchat"; 124 | const string qnaBiologyDispatchKey = "q_StudyBiology"; 125 | const string qnaSociologyDispatchKey = "q_StudySociology"; 126 | const string qnaGeologyDispatchKey = "q_StudyGeology"; 127 | 128 | switch (topIntent.Value.intent) 129 | { 130 | case chitchatDispatchKey: 131 | await DispatchToQnAMakerAsync(context, QnAMakerChitchat); 132 | break; 133 | case qnaBiologyDispatchKey: 134 | await DispatchToQnAMakerAsync(context, QnAMakerBiology); 135 | break; 136 | case qnaSociologyDispatchKey: 137 | await DispatchToQnAMakerAsync(context, QnAMakerSociology); 138 | break; 139 | case qnaGeologyDispatchKey: 140 | await DispatchToQnAMakerAsync(context, QnAMakerGeology); 141 | break; 142 | default: 143 | // The intent didn't match any case, so just display the recognition results. 144 | await context.SendActivityAsync($"Dispatch intent: {topIntent.Value.intent} ({topIntent.Value.score})."); 145 | break; 146 | } 147 | } 148 | 149 | /// 150 | /// Dispatches the turn to the request QnAMaker app. 151 | /// 152 | private async Task DispatchToQnAMakerAsync(ITurnContext context, string appName, CancellationToken cancellationToken = default(CancellationToken)) 153 | { 154 | if (!string.IsNullOrEmpty(context.Activity.Text)) 155 | { 156 | Console.WriteLine("The context from ITurnContext: " + context + "\n"); 157 | 158 | var results = await _services.QnAServices[appName].GetAnswersAsync(context); 159 | 160 | if (results.Any()) 161 | { 162 | foreach (var answer in results) 163 | { 164 | await context.SendActivityAsync(answer.Answer, cancellationToken: cancellationToken); 165 | } 166 | } 167 | else 168 | { 169 | await context.SendActivityAsync($"Couldn't find an answer in the {appName}."); 170 | } 171 | } 172 | } 173 | 174 | /// 175 | /// Dispatches the turn to the requested LUIS model. 176 | /// 177 | private async Task DispatchToLuisModelAsync(ITurnContext context, string appName, CancellationToken cancellationToken = default(CancellationToken)) 178 | { 179 | await context.SendActivityAsync($"Sending your request to the {appName} system ..."); 180 | var result = await _services.LuisServices[appName].RecognizeAsync(context, cancellationToken); 181 | 182 | await context.SendActivityAsync($"Intents detected by the {appName} app:\n\n{string.Join("\n\n", result.Intents)}"); 183 | 184 | if (result.Entities.Count > 0) 185 | { 186 | await context.SendActivityAsync($"The following entities were found in the message:\n\n{string.Join("\n\n", result.Entities)}"); 187 | } 188 | } 189 | 190 | /// 191 | /// On a conversation update activity sent to the bot, the bot will 192 | /// send a message to the any new user(s) that were added. 193 | /// 194 | /// Provides the for the turn of the bot. 195 | /// (Optional) A that can be used by other objects 196 | /// or threads to receive notice of cancellation. 197 | /// >A representing the operation result of the Turn operation. 198 | private static async Task SendWelcomeMessageAsync(ITurnContext turnContext, CancellationToken cancellationToken) 199 | { 200 | foreach (var member in turnContext.Activity.MembersAdded) 201 | { 202 | if (member.Id != turnContext.Activity.Recipient.Id) 203 | { 204 | await turnContext.SendActivityAsync(WelcomeText, cancellationToken: cancellationToken); 205 | } 206 | } 207 | } 208 | } 209 | } -------------------------------------------------------------------------------- /Study-bot-example/Qna-Luis-Bot-v4/README.md: -------------------------------------------------------------------------------- 1 | # Create your Bot 2 | 3 | In this section you will create the bot used for the Study Bot application using the [Microsoft Bot Framework](https://dev.botframework.com). We will also highlight how to handle multiple knowledge bases by using [Dispatch](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=csharp) to "dispatch" user queries in a chat client to the right Microsoft Cognitive Service. Dispatch will direct the user to [LUIS](https://luis.ai), which then directs the user to the right QnA Maker knowledge bases stored in [qnamaker.ai](https://www.qnamaker.ai/). 4 | 5 | The QnA Maker [Chitchat](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base) feature is used as one of the knowledge bases and is integrated into LUIS using the CLI Dispatch tool. Chitchat gives the chat client a more natural, conversational feel when a user chats off-topic, asking questions such as "How are you?", "You're boring", or "Can we be friends?". There are three different personalities you can set Chitchat to when creating it in [qnamaker.ai](https://www.qnamaker.ai/): The Professional, The Friend, or The Comic. This sample uses The Comic setting, since the Study Bot targets high school students. 6 | 7 | [Bing spell check](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-tutorial-bing-spellcheck) was added to the bot to correct light misspellings. 8 | 9 | 10 | ## Create a C# Web App Bot 11 | 12 | 1. [Create a Basic C# web app bot](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart?view=azure-bot-service-4.0) in the [Azure Portal](https://ms.portal.azure.com). 13 | 14 | 1. Find the botFilePath and botFileSecret by going to the Application Settings menu in the Web App Bot you just deployed. Copy these values into the `StudyBotTemplate.txt` file. You'll need these values later. 15 | 16 | 17 | 18 | 1. After your bot deploys (you'll recieve a notification in Azure when it does), download your bot code locally. To do this go to the Build section of the Bot management menu. 19 | 20 | 21 | 22 | 1. Extract all the files and open the solution file in Visual Studio. 23 | 24 | 25 | 1. Update the `appsettings.json` file in the root of the bot project with the botFilePath and botFileSecret. 26 | 27 | The update should look something like this, replacing `` with your unique values: 28 | ```json 29 | { 30 | "botFileSecret": "", 31 | "botFilePath": "./.bot" 32 | } 33 | ``` 34 | 35 | 1. At this point, you can try to test your bot. See 'Run and Test your Bot' below. It's good practice to make sure the basic bot tests fine in the emulator before modifying the code base. 36 | 37 | 1. Copy in the Study bot code. 38 | 39 | Copy the files in this folder (Qna-luis-bot-v4) into the top level folder of the solution you just downloaded. Replace any files that already exist. 40 | 41 | ## Creating the Cognitive Services: QnA Maker and LUIS 42 | 43 | ### QnA Maker 44 | 45 | 1. Deploy a QnA Maker Service in [qnamaker.ai](https://www.qnamaker.ai). When you deploy your QnA Maker service, be sure to choose a 'B' search tier or higher since we will deploy more than 3 search indexes. [Additional Documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/quickstarts/create-publish-knowledge-base) 46 | 47 | 48 | 49 | 1. After the QnA Maker service has been deployed, copy the key into the QnA Maker key section in the `StudyBotTemplate.txt` file. Also note the `region` you chose in the file. You will need these values later. 50 | 51 | 1. For this tutorial you will deploy 4 knowledge bases. For each knowledge base, complete the following steps: 52 | 53 | 1. Choose "Create a knowledge base" in qnamaker.ai 54 | 1. Choose the QnA Service you just deployed 55 | 1. Name the knowledge base according to the table below 56 | 1. Upload the file according to the table below 57 | 1. Click "Create your KB" 58 | 1. You might want to add alternative keywords to your knowledge base questions in qnamaker.ai in addition to the ones already there. To add them to your knowledge bases, go to "My knowledge bases" in [qnamaker.ai](https://www.qnamaker.ai) and in each knowledge base click the "+" sign near each question (after your knowledge bases have been created). Type in the alternative question (term). This is only needed for the Biology, Geology, and Sociology KBs. 59 | 60 | 61 | 1. Click "Save and Train" in the top right 62 | 1. Click "Publish" in the top right and then publish the knowledge base 63 | 1. Copy the knowledgebase ID into the template into the `StudyBotTemplate.txt` file, you will need it later. You can find the ID by looking at the URL in the sample postman code -- see pic below 64 | * Also copy the host url & authorization endpoint key into the template file. These will be the same for all 4 knowledge bases. 65 | 66 | Knowledge Base | File 67 | ------------ | ------------- 68 | StudyBiology | StudyBiology.tsv 69 | StudySociology | StudySociology.tsv 70 | StudyGeology | StudyGeology.tsv 71 | Chitchat | don't upload a file, choose the comic chithcat option 72 | 73 | 74 | 75 | 76 | 77 | NOTE: if you only had one knowledge base in qnamaker.aim you could enable Chit-chat right into that KB. But since we have several, it's best to keep the Chit-chat separate, so a conversational query can go specifically to that knowledge base. 78 | 79 | ### LUIS 80 | 81 | After you have created your web app bot (above), you will see a LUIS app has been auto-created for you in [luis.ai](https://www.luis.ai). We won't actually use this app, we'll replace it with our Dispatch app later in this tutorial. This Dispatch app will be created through Dispatch commands. 82 | 83 | Find the LUIS authoring key in the "Setttings" menu on the drop down menu when you click on your account name in the upper right corner on luis.ai. Copy this key into the `StudyBotTemplate.txt` file. You will need this key later in the tutorial. 84 | 85 | ## Adding services to your .bot file & creating Dispatch 86 | 87 | ### Install BotBuilder Tools 88 | 89 | 1. Ensure you have [Node.js](https://nodejs.org/) version 8.5 or higher 90 | ```cmd 91 | node --version 92 | ``` 93 | 94 | 1. Install the bot-builder tools. In a command prompt/terminal navigate to your bot project folder and type the command: 95 | ```cmd 96 | npm i -g msbot chatdown ludown qnamaker luis-apis botdispatch luisgen 97 | ``` 98 | ### Add services to your .bot file 99 | The MSBot tool is a command line tool to create and manage bot resources described via a .bot file. See [here](https://github.com/Microsoft/botbuilder-tools/blob/master/packages/MSBot/docs/bot-file.md) to learn more about the `.bot` file. 100 | 101 | 1. Connect QnA Services 102 | 103 | We need to connect the bot to all of the QnA knowledge bases (KB) that you just created. 104 | 105 | For each QnA Maker knowledge base, run the following command. You should have copied the info for each parameter into the StudyBotTemplate.txt file earlier 106 | 107 | ```cmd 108 | msbot connect qna --secret --name --kbId --subscriptionKey --endpointKey --hostname 109 | ``` 110 | 111 | 1. We also want to remove the initial Luis service which was created when you deployed the bot. To do this run the following command: 112 | 113 | ```cmd 114 | msbot disconnect BasicBotLuisApplication --secret 115 | ``` 116 | 117 | 1. Create the dispatch file 118 | 119 | [Dispatch](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/Dispatch) is a command line tool that will create the Dispatch keys and IDs (.dispatch file), a list of all your LUIS utterances that match your QnA Maker knowledge base questions (.json file), create a new Dispatch app in your LUIS account, and connect all your Cognitive Services to the Dispatch system. 120 | 121 | Create a dispatch app by running the following command: 122 | 123 | ``` 124 | dispatch create --bot --secret --luisAuthoringKey --luisAuthoringRegion westus --culture en-us -n --subscriptionKey 125 | ``` 126 | 127 | You can view your new Dispatch app in in the `.dispatch` file that was just created. Also notice the `.json` file now contains a very long list of every utterance you have from your LUIS Dispatch app from all its intents. 128 | 129 | 1. Add the dispatch file & model to your bot 130 | 131 | ``` 132 | msbot connect dispatch --input .dispatch --secret --subscriptionKey 133 | ``` 134 | 135 | 1. This Dispatch sequence also creates a special LUIS app for the Dispatch service in luis.ai. 136 | 137 | Go to your account in luis.ai and find the Dispatch app just created. You can see there is a `None` intent (default) and then your knowledge base intents. You will also see that Dispatch has added a 'q_' pre-fix to the QnA Maker name for each intent. 138 | 139 | 1. After renaming your LUIS intents, train and publish them. It might take a minute or two to see the changes reflected in your responses in the chat client. 140 | 141 | 1. Update the `NlpDispatchBot.cs` file to reference the dispatch service you just created. Update line 29. 142 | 143 | ```cs 144 | public static readonly string DispatchKey = ""; 145 | ``` 146 | 147 | Note: if you used different knowledge base names, you will also need to update the references to these knowledge bases in this file. (approx on line 35 & 123) 148 | 149 | 1. Install the `Microsoft.Bot.Builder.AI.QnA` package.o do this go to **Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution**. 150 | 151 | >**NOTE:** you may need to install version 4.1.5 instead of the latest 152 | 153 | 154 | 155 | #### Enable Bing Spell Check 156 | 157 | 1. [Deploy](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesBingSpellCheck-v7) an instance of Bing Spell Check v7 resource in the Azure portal and copy the key into the `StudyBotTemplate.txt` file. 158 | 159 | 1. Copy the Bing Spell Check key into line 32 in `Start.cs`. 160 | 161 | ```cs 162 | private static string bingSpellCheckKey = ""; 163 | ``` 164 | 165 | ## Run and test your bot 166 | 167 | ### Connect to bot using Bot Framework Emulator 168 | 169 | 1. Build/run your bot project. You'll see a browser window open that confirms success. 170 | 1. Launch the Bot Framework Emulator 171 | 1. File -> Open bot and navigate to your bot project folder 172 | 1. Select `.bot` file and it opens in the emulator. 173 | 1. When you see `[19:15:57]POST 200 conversations.replyToActivity`, your bot is ready to take input. 174 | 1. Type any question (study term or conversational question) from your knowledge bases (from any one) and the answer should be returned. 175 | 1. The chat client can be programmed to be flexible as well. For instance, if a student is studying geology and wants to understand geologic time scales, they might not remember the official terms, but they know it has something to do with "time". Enter "time" into the chat client and notice that three top options are returned that are related to time. 176 | 1. Note: your project must be running in order to use the emulator. 177 | 178 | ## Deploy this bot to Azure 179 | 180 | ### Publish from Visual Studio 181 | 182 | 1. Open the `.PublishSettings` file you find in the PostDeployScripts folder. 183 | 1. Copy the `userPWD` value. 184 | 1. Right-click on your Project of the Solution Explorer in Visual Studio and click the menu item "Publish". 185 | 1. Click the "Publish" button when the file opens and then paste the password you just copied into the popup. 186 | 187 | ## Next steps 188 | 189 | Configure the Study Bot app Windows application [here](../StudyBot/README.md). 190 | 191 | ## Troubleshooting for the Azure Web Chat 192 | 193 | Due to the dispatch commands, it's possible after you publish your code back to Azure that testing in Web Chat won't work, even when your bot works well locally. This is likely due to the app password in your bot being encrypted. If this is the case, changing the app password in your production endpoint should fix it. To do this: 194 | 195 | 1. In Azure, go to the Resource Group of your bot. You can find this by clicking on your web app bot and finding the Resource Group in the Overview menu. 196 | 1. After clicking on the Resource Group, click the Deployments section under Settings in your menu. You will see a list of all of those resources' apps. 197 | 1. Find your bot in that list, it will have the language of your bot and several characters attached to the end of the title, but your bot's name should be there. 198 | 1. Click on that bot name and a panel will open to the right, horizontal scroll to view it. 199 | 1. A few lines down you will see `Deployment details(Download)`, click on the download link. 200 | 1. Open that downloaded .zip and find the `deployment.json` and open it. 201 | 1. On about line 49, you'll see an app password. Copy that value. 202 | 1. Go back to your local copy of your bot and open the `.bot` file. 203 | 1. Paste the app password over the `appPassword` in your `production` endpoint object. 204 | 1. Save and publish back to Azure, then refresh your bot and retest your bot in Web Chat. If this does not resolve the issue, put in a support request in Azure. 205 | 206 | -------------------------------------------------------------------------------- /Study-bot-example/Qna-Luis-Bot-v4/Startup.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using Microsoft.ApplicationInsights; 8 | using Microsoft.ApplicationInsights.Extensibility; 9 | using Microsoft.AspNetCore.Builder; 10 | using Microsoft.AspNetCore.Hosting; 11 | using Microsoft.Bot.Builder; 12 | using Microsoft.Bot.Builder.AI.Luis; 13 | using Microsoft.Bot.Builder.AI.QnA; 14 | using Microsoft.Bot.Builder.BotFramework; 15 | using Microsoft.Bot.Builder.Integration; 16 | using Microsoft.Bot.Builder.Integration.AspNet.Core; 17 | using Microsoft.Bot.Configuration; 18 | using Microsoft.Bot.Connector.Authentication; 19 | using Microsoft.Extensions.Configuration; 20 | using Microsoft.Extensions.DependencyInjection; 21 | using Microsoft.Extensions.Logging; 22 | 23 | namespace Microsoft.BotBuilderSamples 24 | { 25 | /// 26 | /// The Startup class configures services and the app's request pipeline. 27 | /// 28 | public class Startup 29 | { 30 | 31 | // ADD BINGSPELLCHECK KEY FROM YOUR RESOURCE IN THE AZURE PORTAL 32 | private static string bingSpellCheckKey = ""; 33 | 34 | private ILoggerFactory _loggerFactory; 35 | private bool _isProduction = false; 36 | 37 | /// 38 | /// Initializes a new instance of the class. 39 | /// This method gets called by the runtime. Use this method to add services to the container. 40 | /// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940. 41 | /// 42 | /// Provides information about the web hosting environment an application is running in. 43 | /// 44 | public Startup(IHostingEnvironment env) 45 | { 46 | _isProduction = env.IsProduction(); 47 | 48 | var builder = new ConfigurationBuilder() 49 | .SetBasePath(env.ContentRootPath) 50 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 51 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) 52 | .AddEnvironmentVariables(); 53 | 54 | Configuration = builder.Build(); 55 | } 56 | 57 | /// 58 | /// Gets the configuration that represents a set of key/value application configuration properties. 59 | /// 60 | /// 61 | /// The that represents a set of key/value application configuration properties. 62 | /// 63 | public IConfiguration Configuration { get; } 64 | 65 | /// 66 | /// This method gets called by the runtime. Use this method to add services to the container. 67 | /// 68 | /// Specifies the contract for a of service descriptors. 69 | public void ConfigureServices(IServiceCollection services) 70 | { 71 | var secretKey = Configuration.GetSection("botFileSecret")?.Value; 72 | var botFilePath = Configuration.GetSection("botFilePath")?.Value; 73 | 74 | // Loads .bot configuration file and adds a singleton that your Bot can access through dependency injection. 75 | var botConfig = BotConfiguration.Load(botFilePath ?? botFilePath, secretKey); 76 | services.AddSingleton(sp => botConfig ?? throw new InvalidOperationException($"The .bot config file could not be loaded. ({botConfig})")); 77 | 78 | // Retrieve current endpoint. 79 | var environment = _isProduction ? "production" : "development"; 80 | var service = botConfig.Services.Where(s => s.Type == "endpoint" && s.Name == environment).FirstOrDefault(); 81 | if (!(service is EndpointService endpointService)) 82 | { 83 | throw new InvalidOperationException($"The .bot file does not contain an endpoint with name '{environment}'."); 84 | } 85 | 86 | // Add BotServices singleton. 87 | // Create the connected services from .bot file. 88 | var connectedServices = InitBotServices(botConfig); 89 | 90 | services.AddSingleton(sp => connectedServices); 91 | 92 | services.AddBot(options => 93 | { 94 | options.CredentialProvider = new SimpleCredentialProvider(endpointService.AppId, endpointService.AppPassword); 95 | 96 | // Creates a logger for the application to use. 97 | ILogger logger = _loggerFactory.CreateLogger(); 98 | 99 | // Catches any errors that occur during a conversation turn and logs them. 100 | options.OnTurnError = async (context, exception) => 101 | { 102 | logger.LogError($"Exception caught : {exception}"); 103 | await context.SendActivityAsync("Sorry, it looks like something went wrong."); 104 | }; 105 | 106 | // The Memory Storage used here is for local bot debugging only. When the bot 107 | // is restarted, everything stored in memory will be gone. 108 | IStorage dataStore = new MemoryStorage(); 109 | 110 | // For production bots use the Azure Blob or 111 | // Azure CosmosDB storage providers. For the Azure 112 | // based storage providers, add the Microsoft.Bot.Builder.Azure 113 | // Nuget package to your solution. That package is found at: 114 | // https://www.nuget.org/packages/Microsoft.Bot.Builder.Azure/ 115 | // Uncomment the following lines to use Azure Blob Storage 116 | // //Storage configuration name or ID from the .bot file. 117 | // const string StorageConfigurationId = ""; 118 | // var blobConfig = botConfig.FindServiceByNameOrId(StorageConfigurationId); 119 | // if (!(blobConfig is BlobStorageService blobStorageConfig)) 120 | // { 121 | // throw new InvalidOperationException($"The .bot file does not contain an blob storage with name '{StorageConfigurationId}'."); 122 | // } 123 | // // Default container name. 124 | // const string DefaultBotContainer = ""; 125 | // var storageContainer = string.IsNullOrWhiteSpace(blobStorageConfig.Container) ? DefaultBotContainer : blobStorageConfig.Container; 126 | // IStorage dataStore = new Microsoft.Bot.Builder.Azure.AzureBlobStorage(blobStorageConfig.ConnectionString, storageContainer); 127 | 128 | // Create Conversation State object. 129 | // The Conversation State object is where we persist anything at the conversation-scope. 130 | var conversationState = new ConversationState(dataStore); 131 | 132 | options.State.Add(conversationState); 133 | }); 134 | } 135 | 136 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 137 | { 138 | _loggerFactory = loggerFactory; 139 | 140 | app.UseDefaultFiles() 141 | .UseStaticFiles() 142 | .UseBotFramework(); 143 | } 144 | 145 | /// 146 | /// Initialize the bot's references to external services. 147 | /// 148 | /// For example, QnaMaker services are created here. 149 | /// These external services are configured 150 | /// using the class (based on the contents of your ".bot" file). 151 | /// 152 | /// object based on your ".bot" file. 153 | /// A representing client objects to access external services the bot uses. 154 | /// 155 | /// 156 | /// 157 | private static BotServices InitBotServices(BotConfiguration config) 158 | { 159 | var qnaServices = new Dictionary(); 160 | var luisServices = new Dictionary(); 161 | 162 | // Create instance for Bing Spell Check 163 | LuisPredictionOptions lpo = new LuisPredictionOptions 164 | { 165 | BingSpellCheckSubscriptionKey = bingSpellCheckKey, 166 | SpellCheck = true, 167 | }; 168 | 169 | foreach (var service in config.Services) 170 | { 171 | switch (service.Type) 172 | { 173 | case ServiceTypes.Luis: 174 | { 175 | // Create a Luis Recognizer that is initialized and suitable for passing 176 | // into the IBot-derived class (NlpDispatchBot). 177 | // In this case, we're creating a custom class (wrapping the original 178 | // Luis Recognizer client) that logs the results of Luis Recognizer results 179 | // into Application Insights for future anaysis. 180 | if (!(service is LuisService luis)) 181 | { 182 | throw new InvalidOperationException("The LUIS service is not configured correctly in your '.bot' file."); 183 | } 184 | 185 | if (string.IsNullOrWhiteSpace(luis.AppId)) 186 | { 187 | throw new InvalidOperationException("The LUIS Model Application Id ('appId') is required to run this sample. Please update your '.bot' file."); 188 | } 189 | 190 | if (string.IsNullOrWhiteSpace(luis.AuthoringKey)) 191 | { 192 | throw new InvalidOperationException("The Luis Authoring Key ('authoringKey') is required to run this sample. Please update your '.bot' file."); 193 | } 194 | 195 | if (string.IsNullOrWhiteSpace(luis.SubscriptionKey)) 196 | { 197 | throw new InvalidOperationException("The Subscription Key " + luis.SubscriptionKey + "is required to run this sample. Please update your .bot file."); 198 | } 199 | 200 | if (string.IsNullOrWhiteSpace(luis.Region)) 201 | { 202 | throw new InvalidOperationException("The Region ('region') is required to run this sample. Please update your '.bot' file."); 203 | } 204 | 205 | var app = new LuisApplication(luis.AppId, luis.AuthoringKey, luis.GetEndpoint()); 206 | var recognizer = new LuisRecognizer(app); 207 | luisServices.Add(luis.Name.Split("_").LastOrDefault(), recognizer); 208 | break; 209 | } 210 | 211 | case ServiceTypes.Dispatch: 212 | // Create a Dispatch Recognizer that is initialized and suitable for passing 213 | // into the IBot-derived class (NlpDispatchBot). 214 | // In this case, we're creating a custom class (wrapping the original 215 | // Luis Recognizer client) that logs the results of Luis Recognizer results 216 | // into Application Insights for future anaysis. 217 | if (!(service is DispatchService dispatch)) 218 | { 219 | throw new InvalidOperationException("The Dispatch service is not configured correctly in your '.bot' file."); 220 | } 221 | 222 | if (string.IsNullOrWhiteSpace(dispatch.AppId)) 223 | { 224 | throw new InvalidOperationException("The LUIS Model Application Id ('appId') is required to run this sample. Please update your '.bot' file."); 225 | } 226 | 227 | if (string.IsNullOrWhiteSpace(dispatch.AuthoringKey)) 228 | { 229 | throw new InvalidOperationException("The LUIS Authoring Key ('authoringKey') is required to run this sample. Please update your '.bot' file."); 230 | } 231 | 232 | if (string.IsNullOrWhiteSpace(dispatch.SubscriptionKey)) 233 | { 234 | throw new InvalidOperationException("The Subscription Key ('subscriptionKey') is required to run this sample. Please update your '.bot' file."); 235 | } 236 | 237 | if (string.IsNullOrWhiteSpace(dispatch.Region)) 238 | { 239 | throw new InvalidOperationException("The Region ('region') is required to run this sample. Please update your '.bot' file."); 240 | } 241 | 242 | if (string.IsNullOrWhiteSpace(bingSpellCheckKey)) 243 | { 244 | throw new InvalidOperationException("The BingSpellCheckKey ('bingSpellCheckKey') is required to run this sample. Please update your '.bot' file."); 245 | } 246 | 247 | var dispatchApp = new LuisApplication(dispatch.AppId, dispatch.AuthoringKey, dispatch.GetEndpoint()); 248 | 249 | // Since the Dispatch tool generates a LUIS model, we use LuisRecognizer to resolve dispatching of the incoming utterance 250 | var dispatchARecognizer = new LuisRecognizer(dispatchApp, lpo); 251 | luisServices.Add(dispatch.Name.Split("_").Last(), dispatchARecognizer); 252 | break; 253 | 254 | case ServiceTypes.QnA: 255 | { 256 | // Create a QnA Maker that is initialized and suitable for passing into the IBot-derived class (NlpDispatchBot). 257 | // In this case, we're creating a custom class (wrapping the original QnAMaker client) that logs the results 258 | // of QnA Maker into Application Insights for future analysis. 259 | if (!(service is QnAMakerService qna)) 260 | { 261 | throw new InvalidOperationException("The QnA service is not configured correctly in your '.bot' file."); 262 | } 263 | 264 | if (string.IsNullOrWhiteSpace(qna.KbId)) 265 | { 266 | throw new InvalidOperationException("The QnA KnowledgeBaseId ('kbId') is required to run this sample. Please update your '.bot' file."); 267 | } 268 | 269 | if (string.IsNullOrWhiteSpace(qna.EndpointKey)) 270 | { 271 | throw new InvalidOperationException("The QnA EndpointKey ('endpointKey') is required to run this sample. Please update your '.bot' file."); 272 | } 273 | 274 | if (string.IsNullOrWhiteSpace(qna.Hostname)) 275 | { 276 | throw new InvalidOperationException("The QnA Host ('hostname') is required to run this sample. Please update your '.bot' file."); 277 | } 278 | 279 | var qnaEndpoint = new QnAMakerEndpoint() 280 | { 281 | KnowledgeBaseId = qna.KbId, 282 | EndpointKey = qna.EndpointKey, 283 | Host = qna.Hostname, 284 | }; 285 | 286 | // Using QnAMakerOptions class allows you to return the top 3, 4, 5, etc. results 287 | var qnaMaker = new QnAMaker(qnaEndpoint, options: new QnAMakerOptions { Top = 3, ScoreThreshold = .6f }); 288 | // You only want the top answer for Chitchat, otherwise the responses are confusing 289 | var qnaMaker_chitchat = new QnAMaker(qnaEndpoint, options: new QnAMakerOptions { Top = 1, ScoreThreshold = .6f }); 290 | 291 | if (qna.Name == "Chitchat-Shell") 292 | { 293 | qnaServices.Add(qna.Name, qnaMaker_chitchat); 294 | } 295 | else 296 | { 297 | qnaServices.Add(qna.Name, qnaMaker); 298 | } 299 | 300 | break; 301 | } 302 | } 303 | } 304 | 305 | return new BotServices(qnaServices, luisServices); 306 | } 307 | } 308 | } -------------------------------------------------------------------------------- /Study-bot-example/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | topic: sample 3 | languages: 4 | - csharp 5 | services: cognitive-services, qnamaker, chit-chat, luis, language-understanding, bing spell check, speech service 6 | products: 7 | - azure 8 | author: wiazur, chrhoder 9 | --- 10 | # Study Bot Scenario 11 | 12 | This sample walks through how to add speech to a Bot running in a C# windows app. 13 | 14 | In this lab you will create an application for learning study terms in three subjects: Geology, Biology and Sociology. The goal is to enable a more engaging study epxerience where students can study a subject with a customized chat bot along with multiple web resources. 15 | 16 | Each typed or spoken query will be accompanied by relevant search results in an encyclopedia, Microsoft Academic, and a general Bing search as a study aid. Teachers could modify the questions in this sample to create their own study guides. 17 | 18 | We will also enable QnA Maker's chitchat to make the service more conversational. 19 | 20 | This sample uses [Azure Bot Service](https://azure.microsoft.com/en-us/services/bot-service/), [QnA Maker](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/index) (with [Chit-chat](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base)), [LUIS](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/), [Speech Service](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/), and [Bing Spell Check](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-spell-check/). 21 | 22 | Demo FAQs used in this tutorial are included in the Qna-Luis-Bot-v4/FAQs folder. 23 | 24 | ## Features 25 | 26 | * **QnA Maker with LUIS**: 4 knowledge bases will be created in [qnamaker.ai](https://www.qnamaker.ai) for Biology, Geology, Sociology. We will also use the QnA Maker feature [Chitchat](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/how-to/chit-chat-knowledge-base) as a 4th knowledge base to enable a more natural conversation experience. 27 | 28 | * **Bing Spell Check**: Enables the user to make simple spelling mistakes. For instance, from the sociology knowledge base, "Apartheid" can be recognized if the user inputs "apartide", "aparteid", "apartaid", etc. 29 | 30 | * **Speech Service**: By integrating speech services, users can speak their query instead of typing them. Users will enable speech services by pressing a microphone button 31 | 32 | * The web resources will take a student query, like "virus", and return relevant information about it in an encyclopedia, Microsoft Academic, as well as a general Bing search that returns mostly news and blogs on the query. 33 | 34 | ## Prerequisites 35 | 36 | See parent [README](../README.md). 37 | 38 | ## Tutorial Steps 39 | 40 | 1. Deploy and configure the Bot Service. [Follow these steps](./Qna-Luis-Bot-v4/README.md) 41 | 42 | 2. Set-up the study bot app & configure the speech input. [Follow these steps](./StudyBot/README.md) 43 | 44 | -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/Build-the-StudyBot.md: -------------------------------------------------------------------------------- 1 | # Build the Study Bot C#, UWP app from scratch 2 | 3 | To understand the process more, you may want to build this app from scratch, instead of downloading and running the StudyBot app from this sample. The following instruct how to do this. 4 | 5 | 1. Open Visual Studio 2017+, go to File -> New -> Project -> Visual C# -> Windows Universal -> Blank App (Universal Windows). Name your project and press OK. In the New Universal Windows Platform Project popup, choose “Windows 10 Fall Creators Update” for Minimum version. Press OK. 6 | 1. In the Nuget Package Manager, install these additional packages: 7 | * Microsoft.Bot.Connector.DirectLine 8 | * Microsoft.Rest.ClientRuntime 9 | * Microsoft.CognitiveServices.Speech 10 | 1. First, we’ll create the UWP interface. Open your MainPage.xaml and copy/paste all code from [this sample](https://raw.githubusercontent.com/Azure-Samples/cognitive-services-studybot-csharp/master/StudyBot/StudyBot/MainPage.xaml) in Github. 11 | * Make sure your app name is in the Page attribute: 12 | ` x:Class=”.MainPage” … ` 13 | * Also, add your app’s name to the other Page attribute: 14 | ` xmlns:local=”using:” … ` 15 | 1. Notice: the bot is embedded as a `` with components: a list, a text box, and the send and speech buttons. This is your custom WebChat. The tabs (`PivotItems`) below that are websites that will run the user’s query after the query is sent by the user. So, if the user types or speaks “virus” into the WebChat, the websites will search for “virus” and provide results. 16 | 1. Next, we’ll add code to our MainPage.xaml.cs file to provide functionality for our interface. Open your MainPage.xaml.cs file and copy/paste code from [this sample](https://raw.githubusercontent.com/Azure-Samples/cognitive-services-studybot-csharp/master/StudyBot/StudyBot/MainPage.xaml.cs). 17 | 1. In your MainPage.xaml.cs file, change your namespace name at the top to match your app’s name (gets rid of a lot of errors). 18 | 1. Provide your unique values for Cognitive Services at the top:
19 | `string botSecretKey = "";`
20 | *Where to find it*: In the Azure portal, open your web app bot service -> go to Channels - > click the globe icon (this is for Direct Line) -> in that channel (click edit) grab one of the keys (either one works).
21 | `string botHandle = "";`
22 | `string speechSubscription = "";`
23 | *Where to find it*: In the Azure portal, open your Speech Service subscription, look under “Keys”.
24 | `string speechRegion = ""; // ex: westus`
25 | 1. Build/run the application. 26 | You will see the interface below. Type or press the microphone button to speak your queries to get started. 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/README.md: -------------------------------------------------------------------------------- 1 | # Create the Study Bot Application 2 | 3 | This part of the tutorial will create a UWP app which includes an embedded chat client linked to an Azure Bot. This application contains a relevant website query based on the chat queries entered by the student, for instance, if the user wants to know the definition of a "virus". The queries will then act as search terms for an encyclopedia, Microsoft Academic, and a Bing search engine in their respective `WebViews` in the app. 4 | 5 | The steps in this tutorial will walk through how to add a speech input into the chat. We will use [Speech Service](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/) for speech to text. 6 | 7 | 8 | 9 | ## Prerequisites 10 | 11 | Complete the steps for deploying the Study Bot web app bot service [here](../Qna-Luis-Bot-v4/README.md). You will need the bot name and secret key from this sample. You should have copied this into the `StudyAppTemplate.txt` file. 12 | 13 | ## Setup & Run the App 14 | 1. After cloning this repo, open the Study Bot solution file in Visual Studio 2017+. 15 | 16 | 1. In `MainPage.xaml.cs`, add your Qna-Luis-Bot's bot's name (verbatim) to `botHandle`. For example, Qna-Luis-Bot-v4. 17 | 18 | 1. Since the Study Bot UWP app is considered an external client that needs to access the bot in Azure, we'll need to connect it to a Channel called [Direct Line](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-directline?view=azure-bot-service-3.0). To do this go to the Channels menu in your web app bot resource in the Azure portal and click the globe icon. 19 | 20 | 21 | 22 | 1. This initializes the Direct Line channel. A popup appears that has your bot secret key. Copy this into the `StudyBotTemplate.txt` file 23 | 24 | 25 | 26 | 1. Click "Done" at the bottom. Then you will see Direct Line has been added next to Web Chat. 27 | 28 | 29 | 30 | 1. Paste your the Direct Line key into the `botSecretKey` variable at the top of the `MainPage.xaml.cs`. 31 | 32 | 1. Install the `Microsoft.Bot.Builder.AI` package to do this go to **Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution**. 33 | 34 | >**NOTE:** you may need to install version 4.1.5 instead of the latest 35 | 36 | 37 | 38 | 1. Build and Run the application. Ask the chat 'what is lava?' 39 | 40 | ## Add speech to the application 41 | 42 | This section will walk through the process of adding speech to text capabilities to the C# application. 43 | 44 | 1. [Deploy](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesSpeechServices) the speech service from the Azure portal. After the service has deployed, copy the key into the `StudyBotTemplate.txt` file. 45 | 46 | 47 | 1. In the Study Bot app solution, you will need to install the speech NuGet package. Follow the same steps as before and search for `Microsoft.CognitiveServices.Speech` in the NuGet Package Manager. 48 | 49 | 1. Add the Microphone as a capability in the app. Open `Package.appxmanifest` from your solution explorer and go to the "Capabilities" tab and check the **Microphone** box. 50 | 51 | 52 | 53 | 54 | 1. Add a speech button to the app. We will add a microphone icon which we'll call the 'Button_Mic' method when clicked. 55 | 56 | In `MainPage.xaml`, add the following code for a button on line 45: 57 | 58 | ```cs 59 | 62 | ``` 63 | 64 | 1. Add code to handle for when the user clicks the Mic Button. Open the `MainPage.xaml.cs` file in the solution. 65 | 66 | 1. Add the following using statement at the top of the file: 67 | 68 | ```cs 69 | using Microsoft.CognitiveServices.Speech; 70 | ``` 71 | 72 | 1. Add in your speech service key and region inside the `MainPage` class at line 40 next to the bot credentials: 73 | 74 | ```cs 75 | string speechSubscription = ""; 76 | string speechRegion = ""; 77 | ``` 78 | 79 | 1. Update the placeholder text in the chat window. Update the following variable assigment on line 70. 80 | 81 | ```cs 82 | NewMessageTextBox.PlaceholderText = "Type a study term or click the mic button to speak."; 83 | ``` 84 | 85 | 1. Add code for converting input speech to text. Open the `SpeechCode.cs` file and copy the method into the MainPage class. You can copy the code in at line 326. Ths code is derived from the following [sample].(https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-recognize-speech-csharp). It does the following: 86 | 87 | 1. Creates a speech recognizer from the speech configuration. 88 | 89 | 1. Start recognition when the button is clicked. We use `RecognizeOnceAsync()` for single-shot recognition. This method returns the first recognized utterance. 90 | 91 | 1. Recognized text is then sent as a message to the Bot service. 92 | 93 | 1. Changes the Mic icon to red when the app is listening. 94 | 95 | ## Run the updated sample 96 | 97 | 1. Run your StudyBot solution file in Visual Studio. 98 | 99 | 1. In the UWP interface that appears, enter a query, such as "virus" and see the bot respond and the websites perform their search. Click on the Mic icon to speak a query, and you'll see similar results. If the bot does not recognize the query or if the query is conversational chit chat, like "hi, how are you?", no website search will be performed. 100 | -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/SpeechCode.cs: -------------------------------------------------------------------------------- 1 | private async void Button_Mic(object sender, RoutedEventArgs e) 2 | { 3 | // Change color of button when clicked 4 | Button micButton = FindName("MicButton") as Button; 5 | micButton.Background = new SolidColorBrush(Windows.UI.Colors.Red); 6 | 7 | // Speech subscription key and region 8 | var config = SpeechConfig.FromSubscription(speechSubscription, speechRegion); 9 | try 10 | { 11 | // Creates a speech recognizer using microphone as audio input. 12 | using (SpeechRecognizer recognizer = new SpeechRecognizer(config)) 13 | { 14 | // Starts recognition. It returns when the first utterance has been recognized. 15 | var result = await recognizer.RecognizeOnceAsync().ConfigureAwait(false); 16 | 17 | // Checks result. 18 | StringBuilder sb = new StringBuilder(); 19 | if (result.Reason == ResultReason.RecognizedSpeech) 20 | { 21 | 22 | // Activity object with (optional) name of the user and text. "newActivity.Text" holds the spoken user query 23 | newActivity = new Activity { From = new ChannelAccount(userId, userName), Text = result.Text, Type = ActivityTypes.Message }; 24 | 25 | // Grabs query from speech to use in websites 26 | query = newActivity.Text; 27 | 28 | // Post message to your bot. 29 | if (_conversation != null) 30 | { 31 | await _client.Conversations.PostActivityAsync(_conversation.ConversationId, newActivity); 32 | } 33 | 34 | InputQueryToWebsites(); 35 | } 36 | else if (result.Reason == ResultReason.NoMatch) 37 | { 38 | sb.AppendLine($"NOMATCH: Speech could not be recognized."); 39 | } 40 | else if (result.Reason == ResultReason.Canceled) 41 | { 42 | var cancellation = CancellationDetails.FromResult(result); 43 | sb.AppendLine($"CANCELED: Reason={cancellation.Reason}"); 44 | 45 | if (cancellation.Reason == CancellationReason.Error) 46 | { 47 | sb.AppendLine($"CANCELED: ErrorCode={cancellation.ErrorCode}"); 48 | sb.AppendLine($"CANCELED: ErrorDetails={cancellation.ErrorDetails}"); 49 | sb.AppendLine($"CANCELED: Did you update the subscription info?"); 50 | } 51 | } 52 | } 53 | } 54 | catch (Exception ex) 55 | { 56 | Console.WriteLine(ex); 57 | } 58 | 59 | await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => 60 | { 61 | micButton.Background = new SolidColorBrush(Windows.UI.Colors.DarkGray); 62 | }); 63 | } -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudyBot", "StudyBot\StudyBot.csproj", "{88585237-27EB-4F7E-B479-ED2528A81BDE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|ARM = Debug|ARM 11 | Debug|ARM64 = Debug|ARM64 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|ARM = Release|ARM 15 | Release|ARM64 = Release|ARM64 16 | Release|x64 = Release|x64 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|ARM.ActiveCfg = Debug|ARM 21 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|ARM.Build.0 = Debug|ARM 22 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|ARM.Deploy.0 = Debug|ARM 23 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|ARM64.ActiveCfg = Debug|ARM64 24 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|ARM64.Build.0 = Debug|ARM64 25 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|ARM64.Deploy.0 = Debug|ARM64 26 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|x64.ActiveCfg = Debug|x64 27 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|x64.Build.0 = Debug|x64 28 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|x64.Deploy.0 = Debug|x64 29 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|x86.ActiveCfg = Debug|x86 30 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|x86.Build.0 = Debug|x86 31 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Debug|x86.Deploy.0 = Debug|x86 32 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|ARM.ActiveCfg = Release|ARM 33 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|ARM.Build.0 = Release|ARM 34 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|ARM.Deploy.0 = Release|ARM 35 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|ARM64.ActiveCfg = Release|ARM64 36 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|ARM64.Build.0 = Release|ARM64 37 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|ARM64.Deploy.0 = Release|ARM64 38 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|x64.ActiveCfg = Release|x64 39 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|x64.Build.0 = Release|x64 40 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|x64.Deploy.0 = Release|x64 41 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|x86.ActiveCfg = Release|x86 42 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|x86.Build.0 = Release|x86 43 | {88585237-27EB-4F7E-B479-ED2528A81BDE}.Release|x86.Deploy.0 = Release|x86 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {139D2EA3-B122-48AE-92FB-43D4744DB49D} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace StudyBot 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | Frame rootFrame = Window.Current.Content as Frame; 43 | 44 | // Do not repeat app initialization when the Window already has content, 45 | // just ensure that the window is active 46 | if (rootFrame == null) 47 | { 48 | // Create a Frame to act as the navigation context and navigate to the first page 49 | rootFrame = new Frame(); 50 | 51 | rootFrame.NavigationFailed += OnNavigationFailed; 52 | 53 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 54 | { 55 | //TODO: Load state from previously suspended application 56 | } 57 | 58 | // Place the frame in the current Window 59 | Window.Current.Content = rootFrame; 60 | } 61 | 62 | if (e.PrelaunchActivated == false) 63 | { 64 | if (rootFrame.Content == null) 65 | { 66 | // When the navigation stack isn't restored navigate to the first page, 67 | // configuring the new page by passing required information as a navigation 68 | // parameter 69 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 70 | } 71 | // Ensure the current window is active 72 | Window.Current.Activate(); 73 | } 74 | } 75 | 76 | /// 77 | /// Invoked when Navigation to a certain page fails 78 | /// 79 | /// The Frame which failed navigation 80 | /// Details about the navigation failure 81 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 82 | { 83 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 84 | } 85 | 86 | /// 87 | /// Invoked when application execution is being suspended. Application state is saved 88 | /// without knowing whether the application will be terminated or resumed with the contents 89 | /// of memory still intact. 90 | /// 91 | /// The source of the suspend request. 92 | /// Details about the suspend request. 93 | private void OnSuspending(object sender, SuspendingEventArgs e) 94 | { 95 | var deferral = e.SuspendingOperation.GetDeferral(); 96 | //TODO: Save application state and stop any background activity 97 | deferral.Complete(); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/StoreLogo.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/directline-done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/directline-done.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/enable-directline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/enable-directline.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/Assets/robot-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/AddingSpeechToBots/9b672f873706b07844e460a0f1a5d93562eb6ff1/Study-bot-example/StudyBot/StudyBot/Assets/robot-face.png -------------------------------------------------------------------------------- /Study-bot-example/StudyBot/StudyBot/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |