https://github.com/marvinbuss/cognitiveservices-speechandluis
Tool to test the capabilities of the Microsoft Speech and LUIS service.
https://github.com/marvinbuss/cognitiveservices-speechandluis
cognitive-services csharp luis natural-language-understanding speech-to-text testing testing-tools
Last synced: 7 months ago
JSON representation
Tool to test the capabilities of the Microsoft Speech and LUIS service.
- Host: GitHub
- URL: https://github.com/marvinbuss/cognitiveservices-speechandluis
- Owner: marvinbuss
- Created: 2019-06-24T17:02:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-28T11:06:38.000Z (over 6 years ago)
- Last Synced: 2025-02-10T07:42:03.934Z (9 months ago)
- Topics: cognitive-services, csharp, luis, natural-language-understanding, speech-to-text, testing, testing-tools
- Language: C#
- Homepage:
- Size: 28.8 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CognitiveServices-Speech and LUIS testing tool
This small and lightweight tool can be used to quickly test the capabilities of the Speech and LUIS Cognitive Services. The application provides feedback about the Speech to Text conversion and the top intent that was identified by LUIS. Is also returns a list of all entities that were extracted from the utterance.
Also, this tool can be used to quickly add sample utterances to your LUIS model via voice. This is generally much quicker than typing sample utterances in LUIS. The console application is written in .NET Core 2.2 and is adaptible by changing the settings and subscription keys in the `appsettings.json` file, even after compiling the solution.
# Download of Compiled Application
If you do not want to compile the solution yourself, you can just download a compiled version for Windows x64 Systems. Just hit the download button. If you download this version, you will still be able to change the settings of your application. Download the solution by using the following link: [Download Link](SpeechServiceTesting/compiled/win-x64.zip)
# Setup of Speech and LUIS
Before we start, make sure that you have access to the [Speech Service](https://azure.microsoft.com/en-us/services/cognitive-services/speech-services) as well as [LUIS](https://eu.luis.ai), which are part of the Microsoft Cognitive Services. I you are not sure, you can create a new resource for each of them in the Azure Portal:
- [Speech](https://portal.azure.com/#create/Microsoft.CognitiveServicesSpeechServices)
- [LUIS](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesLUIS)
Select `West Europe`, if you are not sure which region to choose. After creating both resources, you have to create a LUIS App. Please follow [these](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/get-started-portal-build-app) steps to do so.
**NOTE:** When deploying the services on Azure, please take note of the selected region. This is very important for later use of the app. Once the deployment was successful, please also take note of the subscription keys of the Cognitive Services.
# Changing Settings of the Application
In this section, I will describe how to use the application and adjust the settings. If you downloaded the compiled version (`win-x64.zip`), you should first unzip the archive. Afterwards, you should see the following files (and more) in the unpacked folder:

Next, open the `appsettings.json` with Notepad or any other preferred tool. In this file, you can adjust the settings, so that the right speech and LUIS model is used. There are three important sections in this file: `Logging`, `SpeechToTextSettings` and `LanguageUnderstandingSettings`.
## Logging
The application writes log-files in the background. This enables you to analyze the results of the Speech and LUIS service later on. The parameters in this section will have the following effect:
- `Logging`: When `true` logging is enabled and if set to `false` logging is disabled.
- `LoggingPath`: With this parameter you can adjust and change the name and path of the log-file that saves the results of the Speech and LUIS service. There is no need to change this value.
- `LoggingPathSpeech`: With this parameter you can adjust and change the name and path of the log-file that saves additional data of the Speech service. There is no need to change this value.
## SpeechToTextSettings
This section contains all the settings for the Speech to Text functionality. The parameters in this section will have the following effect:
- `ServiceRegion`: Set this parameter to the region to which you deployed your Cognitive Service.
- `SubscriptionKey`: Set this parameter to your Speech Subscription Key. You can find the key in the Azure Portal.
- `RecognitionLanguage`: Specifies the name of spoken language to be recognized in BCP-47 format. Set this value to the language that you would like to use for STT. A more comprehensive list of possible values can be found here: https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support
- `DetailedOutput`: When `true` the console application also returns information about alternative transcriptions with lower confidence. This feature only works for a few languages such as `en-US`.
## LanguageUnderstandingSettings
This section contains all the settings for the Natural Language Understanding functionality. The parameters in this section will have the following effect:
- `ServiceRegion`: Set this parameter to the region to which you deployed your Cognitive Service.
- `EndpointPredictionkey`: Set this parameter to the Endpoint Prediction Key of your LUIS app. This key can be found in the app if you navigate to Manage > Keys and Endpoints > Key 1.
- `AppId`: Set this parameter to the App ID of your LUIS app. This ID can be found in the app if you navigate to Manage > Application Information > Application ID.
# Running the Application
Once you have set all values, you can save and close the `appsettings.json` file. Now you can open the console application by double clicking on the `SpeechServiceTesting.exe`. This will open the console application. Here you have two options:
- Click `Esc` to end the application
- Click any other button on the keyboard to start the speech recognition.