Cloud NiFi Processors
  • Calculated Systems NiFi Processors
  • Amazon Web Services
    • Comprehend API
      • DetectDominantLanguage Processor
      • DetectKeyPhrases Processor
      • DetectEntities Processor
        • Entity Types
      • DetectSentiment Processor
      • DetectSyntax Processor
    • Textract API
      • DetectDocumentText Processor
      • AnalyzeDocument Processor
      • Block Types
  • Google Cloud Platform
    • Natural Language API
      • AnalyzeSyntax Processor
      • AnalyzeEntities Processor
      • AnalyzeSentiment Processor
      • AnalyzeEntitiesWithSentiment Processor
      • ClassifyText Processor
      • AnnotateText Processor
      • Entity Types
      • The Metadata Field
Powered by GitBook
On this page
  • Properties
  • Data Output

Was this helpful?

  1. Google Cloud Platform
  2. Natural Language API

AnnotateText Processor

Part of the GCP Natural Language processor family

PreviousClassifyText ProcessorNextEntity Types

Last updated 5 years ago

Was this helpful?

This processor is a convenience-based processor that combines the capabilities of the , , , and ClassifyText processors into one unit.

Both the entities and sentences returned from this processor will have a sentiment attached them.

The output of this processor can easily grow to be incredibly large, especially with large pieces of text. Unless you're actually looking for all of this information at once, consider using the processors with a more granular scope.

Properties

All of our Natural Language processors also include these .

This processor does not have any unique properties outside of the common ones.

Data Output

Field Name

Data Type

Description

sentences

array of Sentence

The list of sentences found by the API

entities

array of Entity

The list of entities found by the API

categories

array of Category

The list of categories found by the API

tokens

array of Token

The list of tokens found by the API

overallSentiment

Sentiment

The sentiment of the text as a whole

language

string

The language code of the language the input string is in

Token

Field Name

Data Type

Description

text

string

The raw text of this token

lemma

string

The root/bare version of this word. Read more about lemma .

beginOffset

int

The number of characters from the beginning of the input string to the beginning of this token

partOfSpeech

PartOfSpeech

A comprehensive list of all of the syntactical information pertaining to this token, such as gender, quantity, person, etcetera.

dependencyEdge

DependencyEdge

Represents dependency tree information for this token. Read more .

Sentiment

Field Name

Data Type

Description

score

float

A number ranging from -1.0 (negative sentiment) to 1.0 (positive sentiment)

magnitude

float

A number ranging from 0 to +inf representing the absolute magnitude of the sentiment (regardless of score). This number can be thought of as the strength of the emotion (e.g., something being very positive, or slightly negative)

Sentence

Field Name

Data Type

Description

text

string

The raw text of this sentence

beginOffset

int

The number of characters from the beginning of the input string to the beginning of this sentence

sentiment

Sentiment

The sentiment of this sentence

DependencyEdge

Field Name

Data Type

Description

headTokenIndex

int

Represents the head of the token in the dependency tree

label

string ()

The parse label for the token

PartOfSpeech

Category

// This example has the tokens field omitted for bevity. For an extensive
// example of the tokens field, view the AnalyzeSyntax processor's example output.
{
   "output":{
      "overallSentiment":{
         "score":0.5,
         "magnitude":1.7
      },
      "tokens": [],
      "entities":[
         {
            "metadata":{
               "wikipedia_url":"https:\/\/en.wikipedia.org\/wiki\/James_Adams_(entrepreneur)",
               "mid":"\/m\/0136zb57"
            },
            "mentions":[
               {
                  "sentiment":{
                     "score":0.9,
                     "magnitude":0.9
                  },
                  "text":"James Adams",
                  "type":"PROPER",
                  "beginOffset":-1
               },
               {
                  "sentiment":{
                     "score":0.9,
                     "magnitude":0.9
                  },
                  "text":"developer",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"PERSON"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "sentiment":{
                     "score":0.0,
                     "magnitude":0.0
                  },
                  "text":"scene",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"LOCATION"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "sentiment":{
                     "score":0.9,
                     "magnitude":0.9
                  },
                  "text":"attitude",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"OTHER"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "sentiment":{
                     "score":0.9,
                     "magnitude":0.9
                  },
                  "text":"work ethic",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"OTHER"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "sentiment":{
                     "score":0.0,
                     "magnitude":0.0
                  },
                  "text":"company",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"ORGANIZATION"
         },
         {
            "metadata":{

            },
            "mentions":[
               {
                  "sentiment":{
                     "score":0.5,
                     "magnitude":0.5
                  },
                  "text":"character",
                  "type":"COMMON",
                  "beginOffset":-1
               }
            ],
            "type":"PERSON"
         }
      ],
      "sentences":[
         {
            "sentiment":{
               "score":0.6,
               "magnitude":0.6
            },
            "text":"James Adams is a fantastic developer who has been on the scene for over ten years.",
            "beginOffset":-1
         },
         {
            "sentiment":{
               "score":0.9,
               "magnitude":0.9
            },
            "text":"His excellent attitude and steady work ethic contribute to his character.",
            "beginOffset":-1
         },
         {
            "sentiment":{
               "score":0.2,
               "magnitude":0.2
            },
            "text":"May he stay with our company for many years to come.",
            "beginOffset":-1
         }
      ],
      "language":"en",
      "categories":[
         {
            "confidence":0.81,
            "name":"\/Arts & Entertainment"
         }
      ]
   },
   "raw-input":"James Adams is a fantastic developer who has been on the scene for over ten years. His excellent attitude and steady work ethic contribute to his character. May he stay with our company for many years to come."
}

Field Name

Data Type

Description

aspect

string ()

The characteristic of a verb that expresses time flow during an event

case

string ()

The grammatical function performed by a noun or pronoun in a phrase, clause, or sentence

form

string ()

Depending on the language, Form can be categorizing different forms of verbs, adjectives, adverbs, etcetera

gender

string ()

Gender classes of nouns reflected in the behavior of associated words

mood

string ()

The grammatical feature of verbs, used for showing modality and attitude

number

string ()

Count distinctions

person

string ()

The distinction between the speaker, second person, third person, etcetera

proper

string ()

Distinguishes if the token is part of a proper name

reciprocity

string ()

Reciprocal features of a pronoun

tag

string ()

A shorthand-tag for what part of speech the token is

tense

string ()

Time reference

voice

string ()

The relationship between the action that a verb expresses and the participants identified by its arguments

Field Name

Data Type

Description

name

string

The name of the category. A list of all possible category names can be

confidence

float

How confident the API is in its response

AnalyzeSyntax
AnalyzeEntities
AnalyzeSentiment
common properties
here
here
DependencyEdgeLabel
Aspect
Case
Form
Gender
Mood
Number
Person
Proper
Reciprocity
Tag
Tense
Voice
found here.