All Natural Language code samples
This page contains code samples for Cloud Natural Language. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.
Quickstart: Perform sentiment analysis by using the gcloud tool
Learn how to perform sentiment analysis by using the Cloud Natural Language API and the Google Cloud SDK.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
Quickstart: Perform sentiment analysis by using client libraries
Learn how to perform a sentiment analysis using the Cloud Natural Language API and the Google Cloud Client Libraries.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Python
- Go
- Java
- JavaScript
Analyze sentiment in a string
Inspect the given text and identify the prevailing emotional opinion.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- Node JS
- JavaScript
- Java
- PHP
- Go
- Python
Analyze sentiment in a Cloud Storage file
Inspect a file stored in Cloud Storage and identify the prevailing emotional opinion within the text.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Java
- JavaScript
- Node JS
- Go
- Python
- PHP
Analyze syntax of a Cloud Storage file
Break up the text from a file stored in Cloud Storage into a series of sentences and tokens (generally, words) and provide linguistic information about those tokens.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- Go
- PHP
- Java
- Python
- Node JS
- JavaScript
Analyze entities in a Cloud Storage file
Inspect text in a file stored in Cloud Storage for known entities (proper nouns such as public figures, and landmarks), and return information about those entities.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- PHP
- Node JS
- Python
- Go
- Java
- JavaScript
Analyze entity sentiment in a Cloud Storage file
Determine the sentiment (positive or negative) expressed about entities within the text from a file stored in Cloud Storage.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- Java
- Python
- Node JS
- JavaScript
- PHP
Analyze entity sentiment in a string
Determine the sentiment (positive or negative) expressed about entities within the text.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- JavaScript
- Go
- PHP
- Node JS
- Python
- Java
Query text
Find the indexed files that are the most similar to the query text.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- Python
Analyze entities in a string
Inspect text for known entities (proper nouns such as public figures and landmarks), and return information about those entities.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Go
- Java
- PHP
- JavaScript
- Python
- Node JS
Analyze sentiment app
A basic Natural Language API application that performs sentiment analysis on text.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Python
Query label
Find the indexed files that are the most similar to the query label.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Python
Classify content of a Cloud Storage file
Analyze a file stored in Google Cloud Storage and return a list of content categories that apply to the text found in the document
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- Python
- Java
- PHP
- Go
- Node JS
- JavaScript
Classify text
Analyze text and return a list of content categories that apply to the text.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Node JS
- Java
- Go
- Python
- JavaScript
- PHP
Analyze syntax of a string
Break up the given text into a series of sentences and tokens (generally, words) and provide linguistic information about those tokens.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Python
- Node JS
- PHP
- Java
- JavaScript
- Go
Classify content
Analyze a document and return a list of content categories that apply to the text found in the document.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- Python
Classify text files and write to the index file
Classify each text file in a directory and write the results to the index file.
- Google Cloud
- Cloud Natural Language API
- Cloud Natural Language API
- Python
Detect sentiment
Detect the sentiment of some sample text.
- Cloud Natural Language API
- Google Cloud
- Cloud Natural Language API
- Go
- JavaScript
- Java
- Python
- PHP
- Node JS