Skip to content

Commit

Permalink
Added "Open in Cloud Shell" buttons to README files [(#1254)](GoogleC…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelawyu authored and busunkim96 committed Sep 29, 2020
1 parent e75c06c commit f398686
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 47 deletions.
5 changes: 5 additions & 0 deletions packages/google-cloud-language/samples/snippets/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Google Cloud Natural Language API examples

[![Open in Cloud Shell][shell_img]][shell_link]

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/README.md

This directory contains Python examples that use the
[Google Cloud Natural Language API](https://cloud.google.com/natural-language/).

Expand Down
15 changes: 12 additions & 3 deletions packages/google-cloud-language/samples/snippets/api/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Google Cloud Natural Language API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/api/README.rst


This directory contains samples for Google Cloud Natural Language API. The `Google Cloud Natural Language API`_ provides natural language understanding technologies to developers, including sentiment analysis, entity recognition, and syntax analysis. This API is part of the larger Cloud Machine Learning API.


Expand Down Expand Up @@ -54,6 +58,10 @@ Samples
Analyze syntax
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/api/analyze.py;language/api/README.rst




To run this sample:
Expand All @@ -63,17 +71,18 @@ To run this sample:
$ python analyze.py
usage: analyze.py [-h] {entities,sentiment,syntax} text
Analyzes text using the Google Cloud Natural Language API.
positional arguments:
{entities,sentiment,syntax}
text
optional arguments:
-h, --help show this help message and exit
.. _Google Cloud SDK: https://cloud.google.com/sdk/
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ samples:
- name: Analyze syntax
file: analyze.py
show_help: true

folder: language/api
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Google Cloud Natural Language API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/classify_text/README.rst


This directory contains samples for Google Cloud Natural Language API. The `Google Cloud Natural Language API`_ provides natural language understanding technologies to developers.

This tutorial demostrates how to use the `classify_text` method to classify content category of text files, and use the result to compare texts by their similarity to each other. See the `tutorial page`_ for details about this sample.
Expand All @@ -21,39 +25,20 @@ Setup
Authentication
++++++++++++++

Authentication is typically done through `Application Default Credentials`_,
which means you do not have to change the code to authenticate as long as
your environment has credentials. You have a few options for setting up
authentication:

#. When running locally, use the `Google Cloud SDK`_

.. code-block:: bash
gcloud auth application-default login
#. When running on App Engine or Compute Engine, credentials are already
set-up. However, you may need to configure your Compute Engine instance
with `additional scopes`_.

#. You can create a `Service Account key file`_. This file can be used to
authenticate to Google Cloud Platform services from any environment. To use
the file, set the ``GOOGLE_APPLICATION_CREDENTIALS`` environment variable to
the path to the key file, for example:

.. code-block:: bash
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account.json
This sample requires you to have authentication setup. Refer to the
`Authentication Getting Started Guide`_ for instructions on setting up
credentials for applications.

.. _Application Default Credentials: https://cloud.google.com/docs/authentication#getting_credentials_for_server-centric_flow
.. _additional scopes: https://cloud.google.com/compute/docs/authentication#using
.. _Service Account key file: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount
.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started

Install Dependencies
++++++++++++++++++++

#. Install `pip`_ and `virtualenv`_ if you do not already have them.
#. 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.

.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

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

Expand All @@ -77,6 +62,10 @@ Samples
Classify Text Tutorial
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/classify_text/classify_text_tutorial.py;language/classify_text/README.rst




To run this sample:
Expand All @@ -87,9 +76,13 @@ To run this sample:
usage: classify_text_tutorial.py [-h]
{classify,index,query,query-category} ...
Using the classify_text method to cluster texts.
Using the classify_text method to find content categories of text files,
Then use the content category labels to compare text similarity.
For more information, see the tutorial page at
https://cloud.google.com/natural-language/docs/classify-text-tutorial.
positional arguments:
{classify,index,query,query-category}
classify Classify the input text into categories.
Expand All @@ -101,13 +94,14 @@ To run this sample:
the query label. The list of all available labels:
https://cloud.google.com/natural-
language/docs/categories
optional arguments:
-h, --help show this help message and exit
The client library
-------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ samples:
show_help: true

cloud_client_library: true

folder: language/classify_text
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Google Cloud Natural Language API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/cloud-client/v1/README.rst


This directory contains samples for Google Cloud Natural Language API. The `Google Cloud Natural Language API`_ provides natural language understanding technologies to developers, including sentiment analysis, entity recognition, and syntax analysis. This API is part of the larger Cloud Machine Learning API.

- See the `migration guide`_ for information about migrating to Python client library v0.26.1.
Expand Down Expand Up @@ -58,6 +62,10 @@ Samples
Quickstart
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/cloud-client/v1/quickstart.py;language/cloud-client/v1/README.rst




To run this sample:
Expand All @@ -70,6 +78,10 @@ To run this sample:
Snippets
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/cloud-client/v1/snippets.py;language/cloud-client/v1/README.rst




To run this sample:
Expand All @@ -79,17 +91,20 @@ To run this sample:
$ python snippets.py
usage: snippets.py [-h]
{sentiment-entities-text,sentiment-entities-file,sentiment-text,sentiment-file,entities-text,entities-file,syntax-text,syntax-file}
{classify-text,classify-file,sentiment-entities-text,sentiment-entities-file,sentiment-text,sentiment-file,entities-text,entities-file,syntax-text,syntax-file}
...
This application demonstrates how to perform basic operations with the
Google Cloud Natural Language API
For more information, the documentation at
https://cloud.google.com/natural-language/docs.
positional arguments:
{sentiment-entities-text,sentiment-entities-file,sentiment-text,sentiment-file,entities-text,entities-file,syntax-text,syntax-file}
{classify-text,classify-file,sentiment-entities-text,sentiment-entities-file,sentiment-text,sentiment-file,entities-text,entities-file,syntax-text,syntax-file}
classify-text Classifies content categories of the provided text.
classify-file Classifies content categories of the text in a Google
Cloud Storage file.
sentiment-entities-text
Detects entity sentiment in the provided text.
sentiment-entities-file
Expand All @@ -104,13 +119,14 @@ To run this sample:
syntax-text Detects syntax in the text.
syntax-file Detects syntax in the file located in Google Cloud
Storage.
optional arguments:
-h, --help show this help message and exit
The client library
-------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ samples:
show_help: true

cloud_client_library: true

folder: language/cloud-client/v1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Google Cloud Natural Language API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/cloud-client/v1beta2/README.rst


This directory contains samples for Google Cloud Natural Language API. The `Google Cloud Natural Language API`_ provides natural language understanding technologies to developers, including sentiment analysis, entity recognition, and syntax analysis. This API is part of the larger Cloud Machine Learning API.

- See the `migration guide`_ for information about migrating to Python client library v0.26.1.
Expand Down Expand Up @@ -58,6 +62,10 @@ Samples
Quickstart
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/cloud-client/v1beta2/quickstart.py;language/cloud-client/v1beta2/README.rst




To run this sample:
Expand All @@ -70,6 +78,10 @@ To run this sample:
Snippets
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/cloud-client/v1beta2/snippets.py;language/cloud-client/v1beta2/README.rst




To run this sample:
Expand All @@ -81,13 +93,13 @@ To run this sample:
usage: snippets.py [-h]
{classify-text,classify-file,sentiment-entities-text,sentiment-entities-file,sentiment-text,sentiment-file,entities-text,entities-file,syntax-text,syntax-file}
...
This application demonstrates how to perform basic operations with the
Google Cloud Natural Language API
For more information, the documentation at
https://cloud.google.com/natural-language/docs.
positional arguments:
{classify-text,classify-file,sentiment-entities-text,sentiment-entities-file,sentiment-text,sentiment-file,entities-text,entities-file,syntax-text,syntax-file}
classify-text Classifies content categories of the provided text.
Expand All @@ -107,13 +119,14 @@ To run this sample:
syntax-text Detects syntax in the text.
syntax-file Detects syntax in the file located in Google Cloud
Storage.
optional arguments:
-h, --help show this help message and exit
The client library
-------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ samples:
show_help: true

cloud_client_library: true

folder: language/cloud-client/v1beta2
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Introduction

[![Open in Cloud Shell][shell_img]][shell_link]

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/movie_nl/README.md
This sample is an application of the Google Cloud Platform Natural Language API.
It uses the [imdb movie reviews data set](https://www.cs.cornell.edu/people/pabo/movie-review-data/)
from [Cornell University](http://www.cs.cornell.edu/) and performs sentiment & entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@


[![Open in Cloud Shell][shell_img]][shell_link]

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/ocr_nl/README.md
# Using the Cloud Natural Language API to analyze image text found with Cloud Vision

This example uses the [Cloud Vision API](https://cloud.google.com/vision/) to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Introduction

[![Open in Cloud Shell][shell_img]][shell_link]

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/sentiment/README.md

This sample contains the code referenced in the
[Sentiment Analysis Tutorial](http://cloud.google.com/natural-language/docs/sentiment-tutorial)
within the Google Cloud Natural Language API Documentation. A full walkthrough of this sample
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Using the Cloud Natural Language API to find subject-verb-object triples in text

[![Open in Cloud Shell][shell_img]][shell_link]

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=language/syntax_triples/README.md

This example finds subject-verb-object triples in a given piece of text using
syntax analysis capabilities of
[Cloud Natural Language API](https://cloud.google.com/natural-language/).
Expand Down
Loading

0 comments on commit f398686

Please sign in to comment.