Cloud Natural Language API Connector Overview

The Workflows connector defines the built-in functions that can be used to access other Google Cloud products within a workflow.

This page provides an overview of the individual connector. There is no need to import or load connector libraries in a workflow—connectors work out of the box when used in a call step.

Cloud Natural Language API

Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers. To learn more, see the Cloud Natural Language API documentation.

Cloud Natural Language connector sample

YAML

# This workflow demonstrates how to use the Cloud Language connector.
# The workflow analyzes some texts and returns "SUCCESS".
# Expected successful output: "SUCCESS"
- init:
    assign:
      - docType: "PLAIN_TEXT"
- analyze_entities:
    call: googleapis.language.v1.documents.analyzeEntities
    args:
      body:
        document:
          type: ${docType}
          language: "en"
          content: "Eiffel Tower"
        encodingType: "UTF8"
- classify_text:
    call: googleapis.language.v1.documents.analyzeSentiment
    args:
      body:
        document:
          type: ${docType}
          language: "en"
          content: "I love workflows!"
        encodingType: "UTF8"
- the_end:
    return: "SUCCESS"

JSON

[
  {
    "init": {
      "assign": [
        {
          "docType": "PLAIN_TEXT"
        }
      ]
    }
  },
  {
    "analyze_entities": {
      "call": "googleapis.language.v1.documents.analyzeEntities",
      "args": {
        "body": {
          "document": {
            "type": "${docType}",
            "language": "en",
            "content": "Eiffel Tower"
          },
          "encodingType": "UTF8"
        }
      }
    }
  },
  {
    "classify_text": {
      "call": "googleapis.language.v1.documents.analyzeSentiment",
      "args": {
        "body": {
          "document": {
            "type": "${docType}",
            "language": "en",
            "content": "I love workflows!"
          },
          "encodingType": "UTF8"
        }
      }
    }
  },
  {
    "the_end": {
      "return": "SUCCESS"
    }
  }
]

Module: googleapis.language.v1.documents

Functions
analyzeEntities Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.
analyzeEntitySentiment Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions.
analyzeSentiment Analyzes the sentiment of the provided text.
analyzeSyntax Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
annotateText A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.
classifyText Classifies a document into categories.

Module: googleapis.language.v1beta2.documents

Functions
analyzeEntities Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.
analyzeEntitySentiment Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions.
analyzeSentiment Analyzes the sentiment of the provided text.
analyzeSyntax Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
annotateText A convenience method that provides all syntax, sentiment, entity, and classification features in one call.
classifyText Classifies a document into categories.