|
| 1 | +.. This file is automatically generated. Do not edit this file directly. |
| 2 | +
|
| 3 | +Google Cloud Speech-to-Text On-Prem Python Samples |
| 4 | +=============================================================================== |
| 5 | + |
| 6 | + |
| 7 | +.. 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. |
| 8 | + |
| 9 | +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. |
| 10 | + |
| 11 | + |
| 12 | +.. _Google Cloud Speech-to-Text On-Prem: https://cloud.google.com/speech-to-text/on-prem/priv/docs |
| 13 | + |
| 14 | +.. _contact us: https://cloud.google.com/contact |
| 15 | + |
| 16 | +.. _Google Cloud Speech-to-Text On-Prem: https://cloud.google.com/speech-to-text/on-prem/priv/docs |
| 17 | + |
| 18 | +Setup |
| 19 | +------------------------------------------------------------------------------- |
| 20 | + |
| 21 | + |
| 22 | +Prepare and Deploy API |
| 23 | ++++++++++++++++++++++++ |
| 24 | + |
| 25 | +This sample requires you to have a Kubernetes cluster with the Speech-to-Text On-Prem service deployed. Follow the quickstart steps listed below: |
| 26 | + |
| 27 | +#. `Setup IAM, Kubernetes, Billing`_ |
| 28 | + |
| 29 | +#. `Deploy the API using the UI or command line`_ |
| 30 | + |
| 31 | +#. `Query the API to ensure it's working`_ |
| 32 | + |
| 33 | + |
| 34 | +.. _Query the API to ensure it's working: |
| 35 | + https://cloud.google.com/speech-to-text/on-prem/priv/docs/query |
| 36 | + |
| 37 | +.. _Deploy the API using the UI or command line: |
| 38 | + https://cloud.google.com/speech-to-text/on-prem/priv/docs/deploy |
| 39 | + |
| 40 | +.. _Setup IAM, Kubernetes, Billing: |
| 41 | + https://cloud.google.com/speech-to-text/on-prem/priv/docs/before-you-begin |
| 42 | + |
| 43 | +Install Dependencies |
| 44 | +++++++++++++++++++++ |
| 45 | + |
| 46 | +#. Clone python-docs-samples and change directory to the sample directory you want to use. |
| 47 | + |
| 48 | + .. code-block:: bash |
| 49 | +
|
| 50 | + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git |
| 51 | + $ cd python-doc-samples/speech/cloud-client |
| 52 | +
|
| 53 | +#. 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. |
| 54 | + |
| 55 | + .. _Python Development Environment Setup Guide: |
| 56 | + https://cloud.google.com/python/setup |
| 57 | + |
| 58 | +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. |
| 59 | + |
| 60 | + .. code-block:: bash |
| 61 | +
|
| 62 | + $ virtualenv env |
| 63 | + $ source env/bin/activate |
| 64 | +
|
| 65 | +#. Install the dependencies needed to run the samples. |
| 66 | + |
| 67 | + .. code-block:: bash |
| 68 | +
|
| 69 | + $ pip install -r requirements.txt |
| 70 | +
|
| 71 | +.. _pip: https://pip.pypa.io/ |
| 72 | +.. _virtualenv: https://virtualenv.pypa.io/ |
| 73 | + |
| 74 | +Samples |
| 75 | +------------------------------------------------------------------------------- |
| 76 | + |
| 77 | +transcribe_onprem |
| 78 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 79 | + |
| 80 | + |
| 81 | +You can run this sample one of two ways, using a **public IP**: |
| 82 | + |
| 83 | +.. code-block:: bash |
| 84 | +
|
| 85 | + # Using a Public IP |
| 86 | + $ python transcribe_onprem.py --file_path="../resources/two_channel_16k.wav" --api_endpoint=${PUBLIC_IP}:443 |
| 87 | +
|
| 88 | +or by using a **cluster level IP**: |
| 89 | + |
| 90 | +.. code-block:: bash |
| 91 | +
|
| 92 | + # Using a cluster level IP |
| 93 | + $ kubectl port-forward -n $NAMESPACE $POD 10000:443 |
| 94 | + $ python transcribe_onprem.py --file_path="../resources/two_channel_16k.wav" --api_endpoint="0.0.0.0:10000" |
| 95 | +
|
| 96 | +The client library |
| 97 | +------------------------------------------------------------------------------- |
| 98 | + |
| 99 | +This sample uses the `Google Cloud Client Library for Python`_. |
| 100 | +You can read the documentation for more details on API usage and use GitHub |
| 101 | +to `browse the source`_ and `report issues`_. |
| 102 | + |
| 103 | +.. _Google Cloud Client Library for Python: |
| 104 | + https://googlecloudplatform.github.io/google-cloud-python/ |
| 105 | +.. _browse the source: |
| 106 | + https://github.com/GoogleCloudPlatform/google-cloud-python |
| 107 | +.. _report issues: |
| 108 | + https://github.com/GoogleCloudPlatform/google-cloud-python/issues |
| 109 | + |
| 110 | + |
| 111 | +.. _Google Cloud SDK: https://cloud.google.com/sdk/ |
0 commit comments