Sign inSign up

antsu/on-prem-client

By antsu

•Updated about 5 years ago

Image
1

2.0K

antsu/on-prem-client repository overview

⁠Cognitive Speech Service Client

This is the docker image used for building a docker container that has Cognitive Speech Service⁠ clients built in.

⁠Introduction

This docker image includes two clients:

ClientDescription
speech-to-text-clientThe client to hit speech-to-text service
text-to-speech-clientThe client to hit text-to-speech service
single-language-detection-clientThe client to hit speech-language-detection service
continuous-language-detection-clientThe client to hit speech-language-detection service
speech-to-text-with-languagedetection-clientThe client to hit both speech-to-text and speech-language-detection service

Both of these clients are implemented in Python3.x.
speech-to-text-client is implemented based on Speech SDK⁠
text-to-speech-client is as REST API Client⁠
single-language-detection-client is implemented based on Speech SDK⁠
continuous-language-detection-client is implemented based on Speech SDK⁠
speech-to-text-with-languagedetection-client is implemented based on Speech SDK⁠

This image has been published to docker.io/antsu/on-prem-client:latest⁠ for public.

⁠Update

  • azure-cognitiveservices-speechis updated to latest version: 1.18.0
  • A 1.18 tag version is added, which uses Speech SDK 1.18 (Note: speech-to-text clientuses dictation api only)
  • A 1.11 tag version is added, which uses Speech SDK 1.11 (Note: speech-to-text clientuses dictation api only)
  • A 1.8 tag version is added, which uses Speech SDK 1.8 (Note: speech-to-text clientuses dictation api only)
  • A 1.7 tag version is added, which uses Speech SDK 1.7 (Note: speech-to-text clientuses dictation api only)

⁠Prerequisites

  • Docker 18.09 or newer
⁠speech-to-text client

To run client, use docker run command, i.e.

docker run --rm -ti <YOUR_IMAGE_URI>:<YOUR_IMAGE_TAG> ./speech-to-text-client --host 51.143.123.142 --port 80 --expect "What's the weather like" ./audio/whatstheweatherlike.wav

Run ./speech-to-text-client -h, you can get an instruction on how to use each argument/option.

Note:

  • [Linux users] If you run speech-to-text docker container and this test client container on the same local host, you should add --network=host in the command above before image, to enable the test client docker container using the local host networking⁠.
    [Mac/Windows users] --network=host is not needed. Please add argument --mac or windows after image instead to indicate which platform the container is running on.
  • If you want to use your own local audio file instead of the image-included whatstheweatherlike.wav, you should mount local directory to docker to make it able to reach your local audio files.
    To do that, add -v <YOUR_LOCAL_AUDIO_FILE_DIR>:<DOCKER_DIR_YOU_WANT_TO_MOUNT_TO> in the command above before image.
ArgumentShortDescriptionRequiredDefaultSample
--host-hoSpecifies the speech-to-text service hostuse with --port500051.143.123.142
--port-poSpecifies the speech-to-text service portuse with --hostlocal80
--region-rSpecifies the region of Azure subscription.
Default is local, which indicates using host:port as service endpoint.
If provided value of valid region (i.e. westus), a valid Azure subscription is required at the same time
use with --subscriptionlocalwestus
--subscription-sSpecifies the Azure subscriptionuse with --region00000000000000000000000000000000A356AC8C-E310-44F4-BF85-C7F29044AF99
--expect-expSpecifies the expected text result of STToptionalWhat's the weather like
wav_fileSpecifies the audio file path.
A sample audio file is provided in this image: ./audio/whatstheweatherlike.wav.
To use your own audio file, put it under ./audio or other dicretory you want. Docker image rebuilt is required.
yes./audio/whatstheweatherlike.wav
⁠text-to-speech client

To run client, use docker run command, i.e.

docker run --rm -v ${HOME}:/root -ti <YOUR_IMAGE_URI>:<YOUR_IMAGE_TAG> ./text-to-speech-client --host 51.143.123.142 --port 80 -i "what is that"

Run ./text-to-speech-client -h, you can get an instruction on how to use each argument/option.

Note:

  • [Linux users] If you run text-to-speech docker container and this test client container on the same local host, you should add --network=host in the command above before image, to enable the test client docker container using the local host networking⁠.
    [Mac/Windows users] --network=host is not needed. Please add argument --mac or windows after image instead to indicate which platform the container is running on.
ArgumentShortDescriptionRequiredDefaultSample
--host-hoSpecifies the text-to-speech service hostuse with --port500051.143.123.142
--port-poSpecifies the text-to-speech service portuse with --hostlocal80
--voicename-vnSpecifies the voice name to hit text-to-speech serviceoptionalJessaRUSJessaRUS
--locale-lSpecifies the locale of text inputoptionalen-USen-US
--region-rSpecifies the region of Azure subscription.
Default is local, which indicates using host:port as service endpoint.
If provided value of valid region (i.e. westus), a valid Azure subscription is required at the same time
use with --subscriptionlocalwestus
--subscription-sSpecifies the Azure subscriptionuse with --region00000000000000000000000000000000A356AC8C-E310-44F4-BF85-C7F29044AF99
--input-iSpecifies the text inputoptional, -i or -if must have one of themWhat is that
--inputfile-ifSpecifies the path of input text fileoptional, -i or -if must have one of them~/path/to/text/input
--resourcename-rnSpecifies the Azure source nameuse with --subscriptionfake_resource_name
⁠speech-to-text-with-languagedetection client

To run client, use docker run command, i.e.

docker run --rm -v ${HOME}:/root -ti <YOUR_IMAGE_URI>:<YOUR_IMAGE_TAG> ./speech-to-text-with-languagedetection-client <wav_file> --host 51.143.123.142 --lport 5003 --sport 5000

Run ./single-language-detection-client -h, you can get an instruction on how to use each argument/option.

Note:

  • [Linux users] If you run speech-to-text-with-languagedetection docker container and this test client container on the same local host, you should add --network=host in the command above before image, to enable the test client docker container using the local host networking⁠.
    [Mac/Windows users] --network=host is not needed. Please add argument --mac or windows after image instead to indicate which platform the container is running on.

Note:
the wav_file for the Language Detection is recommeded for more than 5 seconds of speech, if the audio has less than 5 seconds, Langauge Detection may fail.

ArgumentShortDescriptionRequiredDefaultSample
--host-hoSpecifies the speech-to-text-with-languagedetection service hostuse with --lport and --sport5000 and 500351.143.123.142
--subscription-sSpecifies the Azure subscriptionuse with --region00000000000000000000000000000000A356AC8C-E310-44F4-BF85-C7F29044AF99
--port-pSpecifies the speech-to-text-with-languagedetection service portuse with --hostlocal5003
--languagepriority-lpSpecifies the speech-to-text-with-languagedetection service single languageId priorityLatency or AccuracyLatency
--input-iSpecifies the text inputoptional, -i or -if must have one of themWhat is that
wav_fileSpecifies the audio file path.
A sample audio file is provided in this image: ./audio/whatstheweatherlike.wav.
To use your own audio file, put it under ./audio or other dicretory you want. Docker image rebuilt is required.
yes./audio/whatstheweatherlike.wav

Run ./continuous-language-detection-client -h, you can get an instruction on how to use each argument/option.

Note:

  • [Linux users] If you run speech-to-text-with-languagedetection docker container and this test client container on the same local host, you should add --network=host in the command above before image, to enable the test client docker container using the local host networking⁠.
    [Mac/Windows users] --network=host is not needed. Please add argument --mac or windows after image instead to indicate which platform the container is running on.

Note:
the wav_file for the Language Detection is recommeded for more than 5 seconds of speech, if the audio has less than 5 seconds, Langauge Detection may fail.

ArgumentShortDescriptionRequiredDefaultSample
--host-hoSpecifies the speech-to-text-with-languagedetection service hostuse with --lport and --sport5000 and 500351.143.123.142
--subscription-sSpecifies the Azure subscriptionuse with --region00000000000000000000000000000000A356AC8C-E310-44F4-BF85-C7F29044AF99
--port-pSpecifies the speech-to-text-with-languagedetection service portuse with --hostlocal5003
--languagepriority-lpSpecifies the speech-to-text-with-languagedetection service continuous languageId priorityLatency or AccuracyLatency
--input-iSpecifies the text inputoptional, -i or -if must have one of themWhat is that
wav_fileSpecifies the audio file path.
A sample audio file is provided in this image: ./audio/LanguageDetection_continuous_en-us.wav.
To use your own audio file, put it under ./audio or other dicretory you want. Docker image rebuilt is required.
yes./audio/whatstheweatherlike.wav

Run ./speech-to-text-with-languagedetection-client -h, you can get an instruction on how to use each argument/option.

Note:

  • [Linux users] If you run speech-to-text-with-languagedetection docker container and this test client container on the same local host, you should add --network=host in the command above before image, to enable the test client docker container using the local host networking⁠.
    [Mac/Windows users] --network=host is not needed. Please add argument --mac or windows after image instead to indicate which platform the container is running on.

Note:
the wav_file for the Language Detection is recommeded for more than 5 seconds of speech, if the audio has less than 5 seconds, Langauge Detection may fail.

ArgumentShortDescriptionRequiredDefaultSample
--host-hoSpecifies the speech-to-text-with-languagedetection service hostuse with --lport and --sport5000 and 500351.143.123.142
--subscription-sSpecifies the Azure subscriptionuse with --region00000000000000000000000000000000A356AC8C-E310-44F4-BF85-C7F29044AF99
--lport-lpSpecifies the speech-to-text-with-languagedetection service portuse with --hostlocal5003
--sport-lpSpecifies the speech-to-text-with-languagedetection service portuse with --hostlocal5000
--input-iSpecifies the text inputoptional, -i or -if must have one of themWhat is that
wav_fileSpecifies the audio file path.
A sample audio file is provided in this image: ./audio/whatstheweatherlike.wav.
To use your own audio file, put it under ./audio or other dicretory you want. Docker image rebuilt is required.
yes./audio/whatstheweatherlike.wav

⁠Clean

To remove clients, just remove the docker image.
docker rmi <IMAGE_ID>

Tag summary

Content type

Image

Digest

Size

209.2 MB

Last updated

about 5 years ago

docker pull antsu/on-prem-client