Warning
This product is only available to customers that have been granted access. Please contact us to request access to the Speech-to-Text On-Prem feature.
This directory contains samples for Google Cloud Speech-to-Text On-Prem. Speech-to-Text On-Prem enables easy integration of Google speech recognition technologies into your on-prem solution.
This sample requires you to have a Kubernetes cluster with the Speech-to-Text On-Prem service deployed. Follow the quickstart steps listed below:
- Setup IAM, Kubernetes, Billing
- Deploy the API using the UI or command line
- Query the API to ensure it's working
Clone python-docs-samples and change directory to the sample directory you want to use.
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git $ cd python-doc-samples/speech/cloud-clientInstall pip and virtualenv if you do not already have them. You may want to refer to the Python Development Environment Setup Guide for Google Cloud Platform for instructions.
Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
$ virtualenv env $ source env/bin/activateInstall the dependencies needed to run the samples.
$ pip install -r requirements.txt
You can run this sample one of two ways, using a public IP:
# Using a Public IP
$ python transcribe_onprem.py --file_path="../resources/two_channel_16k.wav" --api_endpoint=${PUBLIC_IP}:443or by using a cluster level IP:
# Using a cluster level IP
$ kubectl port-forward -n $NAMESPACE $POD 10000:443
$ python transcribe_onprem.py --file_path="../resources/two_channel_16k.wav" --api_endpoint="0.0.0.0:10000"This sample uses the Google Cloud Client Library for Python. You can read the documentation for more details on API usage and use GitHub to browse the source and report issues.