Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.rst

Google Cloud Speech-to-Text On-Prem Python Samples

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.

Setup

Prepare and Deploy API

This sample requires you to have a Kubernetes cluster with the Speech-to-Text On-Prem service deployed. Follow the quickstart steps listed below:

  1. Setup IAM, Kubernetes, Billing
  2. Deploy the API using the UI or command line
  3. Query the API to ensure it's working

Install Dependencies

  1. 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-client
  2. Install 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.

  3. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

    $ virtualenv env
    $ source env/bin/activate
  4. Install the dependencies needed to run the samples.

    $ pip install -r requirements.txt

Samples

transcribe_onprem

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}:443

or 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"

The client library

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.