As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Cloud Language v1beta2 API

class google.cloud.language_v1beta2.types.AnalyzeEntitiesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The entity analysis request message.

document

Required. Input document.

Type

google.cloud.language_v1beta2.types.Document

encoding_type

The encoding type used by the API to calculate offsets.

Type

google.cloud.language_v1beta2.types.EncodingType

class google.cloud.language_v1beta2.types.AnalyzeEntitiesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The entity analysis response message.

entities

The recognized entities in the input document.

Type

MutableSequence[google.cloud.language_v1beta2.types.Entity]

language

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details.

Type

str

class google.cloud.language_v1beta2.types.AnalyzeEntitySentimentRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The entity-level sentiment analysis request message.

document

Required. Input document.

Type

google.cloud.language_v1beta2.types.Document

encoding_type

The encoding type used by the API to calculate offsets.

Type

google.cloud.language_v1beta2.types.EncodingType

class google.cloud.language_v1beta2.types.AnalyzeEntitySentimentResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The entity-level sentiment analysis response message.

entities

The recognized entities in the input document with associated sentiments.

Type

MutableSequence[google.cloud.language_v1beta2.types.Entity]

language

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details.

Type

str

class google.cloud.language_v1beta2.types.AnalyzeSentimentRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The sentiment analysis request message.

document

Required. Input document.

Type

google.cloud.language_v1beta2.types.Document

encoding_type

The encoding type used by the API to calculate sentence offsets for the sentence sentiment.

Type

google.cloud.language_v1beta2.types.EncodingType

class google.cloud.language_v1beta2.types.AnalyzeSentimentResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The sentiment analysis response message.

document_sentiment

The overall sentiment of the input document.

Type

google.cloud.language_v1beta2.types.Sentiment

language

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details.

Type

str

sentences

The sentiment for all the sentences in the document.

Type

MutableSequence[google.cloud.language_v1beta2.types.Sentence]

class google.cloud.language_v1beta2.types.AnalyzeSyntaxRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The syntax analysis request message.

document

Required. Input document.

Type

google.cloud.language_v1beta2.types.Document

encoding_type

The encoding type used by the API to calculate offsets.

Type

google.cloud.language_v1beta2.types.EncodingType

class google.cloud.language_v1beta2.types.AnalyzeSyntaxResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The syntax analysis response message.

sentences

Sentences in the input document.

Type

MutableSequence[google.cloud.language_v1beta2.types.Sentence]

tokens

Tokens, along with their syntactic information, in the input document.

Type

MutableSequence[google.cloud.language_v1beta2.types.Token]

language

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details.

Type

str

class google.cloud.language_v1beta2.types.AnnotateTextRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The request message for the text annotation API, which can perform multiple analysis types (sentiment, entities, and syntax) in one call.

document

Required. Input document.

Type

google.cloud.language_v1beta2.types.Document

features

Required. The enabled features.

Type

google.cloud.language_v1beta2.types.AnnotateTextRequest.Features

encoding_type

The encoding type used by the API to calculate offsets.

Type

google.cloud.language_v1beta2.types.EncodingType

class Features(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

All available features for sentiment, syntax, and semantic analysis. Setting each one to true will enable that specific analysis for the input. Next ID: 12

extract_syntax

Extract syntax information.

Type

bool

extract_entities

Extract entities.

Type

bool

extract_document_sentiment

Extract document-level sentiment.

Type

bool

extract_entity_sentiment

Extract entities and their associated sentiment.

Type

bool

classify_text

Classify the full document into categories. If this is true, the API will use the default model which classifies into a predefined taxonomy.

Type

bool

moderate_text

Moderate the document for harmful and sensitive categories.

Type

bool

classification_model_options

The model options to use for classification. Defaults to v1 options if not specified. Only used if classify_text is set to true.

Type

google.cloud.language_v1beta2.types.ClassificationModelOptions

class google.cloud.language_v1beta2.types.AnnotateTextResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The text annotations response message.

sentences

Sentences in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].

Type

MutableSequence[google.cloud.language_v1beta2.types.Sentence]

tokens

Tokens, along with their syntactic information, in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].

Type

MutableSequence[google.cloud.language_v1beta2.types.Token]

entities

Entities, along with their semantic information, in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entities].

Type

MutableSequence[google.cloud.language_v1beta2.types.Entity]

document_sentiment

The overall sentiment for the document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment].

Type

google.cloud.language_v1beta2.types.Sentiment

language

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][google.cloud.language.v1beta2.Document.language] field for more details.

Type

str

categories

Categories identified in the input document.

Type

MutableSequence[google.cloud.language_v1beta2.types.ClassificationCategory]

moderation_categories

Harmful and sensitive categories identified in the input document.

Type

MutableSequence[google.cloud.language_v1beta2.types.ClassificationCategory]

class google.cloud.language_v1beta2.types.ClassificationCategory(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents a category returned from the text classifier.

name

The name of the category representing the document.

Type

str

confidence

The classifier’s confidence of the category. Number represents how certain the classifier is that this category represents the given text.

Type

float

class google.cloud.language_v1beta2.types.ClassificationModelOptions(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Model options available for classification requests.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

v1_model

Setting this field will use the V1 model and V1 content categories version. The V1 model is a legacy model; support for this will be discontinued in the future.

This field is a member of oneof model_type.

Type

google.cloud.language_v1beta2.types.ClassificationModelOptions.V1Model

v2_model

Setting this field will use the V2 model with the appropriate content categories version. The V2 model is a better performing model.

This field is a member of oneof model_type.

Type

google.cloud.language_v1beta2.types.ClassificationModelOptions.V2Model

class V1Model(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Options for the V1 model.

class V2Model(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Options for the V2 model.

content_categories_version

The content categories used for classification.

Type

google.cloud.language_v1beta2.types.ClassificationModelOptions.V2Model.ContentCategoriesVersion

class ContentCategoriesVersion(value)[source]

Bases: proto.enums.Enum

The content categories used for classification.

Values:
CONTENT_CATEGORIES_VERSION_UNSPECIFIED (0):

If ContentCategoriesVersion is not specified, this option will default to V1.

V1 (1):

Legacy content categories of our initial launch in 2017.

V2 (2):

Updated content categories in 2022.

class google.cloud.language_v1beta2.types.ClassifyTextRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The document classification request message.

document

Required. Input document.

Type

google.cloud.language_v1beta2.types.Document

classification_model_options

Model options to use for classification. Defaults to v1 options if not specified.

Type

google.cloud.language_v1beta2.types.ClassificationModelOptions

class google.cloud.language_v1beta2.types.ClassifyTextResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The document classification response message.

categories

Categories representing the input document.

Type

MutableSequence[google.cloud.language_v1beta2.types.ClassificationCategory]

class google.cloud.language_v1beta2.types.DependencyEdge(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents dependency parse tree information for a token.

head_token_index

Represents the head of this token in the dependency tree. This is the index of the token which has an arc going to this token. The index is the position of the token in the array of tokens returned by the API method. If this token is a root token, then the head_token_index is its own index.

Type

int

label

The parse label for the token.

Type

google.cloud.language_v1beta2.types.DependencyEdge.Label

class Label(value)[source]

Bases: proto.enums.Enum

The parse label enum for the token.

Values:
UNKNOWN (0):

Unknown

ABBREV (1):

Abbreviation modifier

ACOMP (2):

Adjectival complement

ADVCL (3):

Adverbial clause modifier

ADVMOD (4):

Adverbial modifier

AMOD (5):

Adjectival modifier of an NP

APPOS (6):

Appositional modifier of an NP

ATTR (7):

Attribute dependent of a copular verb

AUX (8):

Auxiliary (non-main) verb

AUXPASS (9):

Passive auxiliary

CC (10):

Coordinating conjunction

CCOMP (11):

Clausal complement of a verb or adjective

CONJ (12):

Conjunct

CSUBJ (13):

Clausal subject

CSUBJPASS (14):

Clausal passive subject

DEP (15):

Dependency (unable to determine)

DET (16):

Determiner

DISCOURSE (17):

Discourse

DOBJ (18):

Direct object

EXPL (19):

Expletive

GOESWITH (20):

Goes with (part of a word in a text not well edited)

IOBJ (21):

Indirect object

MARK (22):

Marker (word introducing a subordinate clause)

MWE (23):

Multi-word expression

MWV (24):

Multi-word verbal expression

NEG (25):

Negation modifier

NN (26):

Noun compound modifier

NPADVMOD (27):

Noun phrase used as an adverbial modifier

NSUBJ (28):

Nominal subject

NSUBJPASS (29):

Passive nominal subject

NUM (30):

Numeric modifier of a noun

NUMBER (31):

Element of compound number

P (32):

Punctuation mark

PARATAXIS (33):

Parataxis relation

PARTMOD (34):

Participial modifier

PCOMP (35):

The complement of a preposition is a clause

POBJ (36):

Object of a preposition

POSS (37):

Possession modifier

POSTNEG (38):

Postverbal negative particle

PRECOMP (39):

Predicate complement

PRECONJ (40):

Preconjunt

PREDET (41):

Predeterminer

PREF (42):

Prefix

PREP (43):

Prepositional modifier

PRONL (44):

The relationship between a verb and verbal morpheme

PRT (45):

Particle

PS (46):

Associative or possessive marker

QUANTMOD (47):

Quantifier phrase modifier

RCMOD (48):

Relative clause modifier

RCMODREL (49):

Complementizer in relative clause

RDROP (50):

Ellipsis without a preceding predicate

REF (51):

Referent

REMNANT (52):

Remnant

REPARANDUM (53):

Reparandum

ROOT (54):

Root

SNUM (55):

Suffix specifying a unit of number

SUFF (56):

Suffix

TMOD (57):

Temporal modifier

TOPIC (58):

Topic marker

VMOD (59):

Clause headed by an infinite form of the verb that modifies a noun

VOCATIVE (60):

Vocative

XCOMP (61):

Open clausal complement

SUFFIX (62):

Name suffix

TITLE (63):

Name title

ADVPHMOD (64):

Adverbial phrase modifier

AUXCAUS (65):

Causative auxiliary

AUXVV (66):

Helper auxiliary

DTMOD (67):

Rentaishi (Prenominal modifier)

FOREIGN (68):

Foreign words

KW (69):

Keyword

LIST (70):

List for chains of comparable items

NOMC (71):

Nominalized clause

NOMCSUBJ (72):

Nominalized clausal subject

NOMCSUBJPASS (73):

Nominalized clausal passive

NUMC (74):

Compound of numeric modifier

COP (75):

Copula

DISLOCATED (76):

Dislocated relation (for fronted/topicalized elements)

ASP (77):

Aspect marker

GMOD (78):

Genitive modifier

GOBJ (79):

Genitive object

INFMOD (80):

Infinitival modifier

MES (81):

Measure

NCOMP (82):

Nominal complement of a noun

class google.cloud.language_v1beta2.types.Document(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents the input to API methods.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

type_

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

Type

google.cloud.language_v1beta2.types.Document.Type

content

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

This field is a member of oneof source.

Type

str

gcs_content_uri

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

This field is a member of oneof source.

Type

str

language

The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

Type

str

reference_web_uri

The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.

Type

str

boilerplate_handling

Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.

Type

google.cloud.language_v1beta2.types.Document.BoilerplateHandling

class BoilerplateHandling(value)[source]

Bases: proto.enums.Enum

Ways of handling boilerplate detected in the document

Values:
BOILERPLATE_HANDLING_UNSPECIFIED (0):

The boilerplate handling is not specified.

SKIP_BOILERPLATE (1):

Do not analyze detected boilerplate. Reference web URI is required for detecting boilerplate.

KEEP_BOILERPLATE (2):

Treat boilerplate the same as content.

class Type(value)[source]

Bases: proto.enums.Enum

The document types enum.

Values:
TYPE_UNSPECIFIED (0):

The content type is not specified.

PLAIN_TEXT (1):

Plain text

HTML (2):

HTML

class google.cloud.language_v1beta2.types.EncodingType(value)[source]

Bases: proto.enums.Enum

Represents the text encoding that the caller uses to process the output. Providing an EncodingType is recommended because the API provides the beginning offsets for various outputs, such as tokens and mentions, and languages that natively use different text encodings may access offsets differently.

Values:
NONE (0):

If EncodingType is not specified, encoding-dependent information (such as begin_offset) will be set at -1.

UTF8 (1):

Encoding-dependent information (such as begin_offset) is calculated based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively.

UTF16 (2):

Encoding-dependent information (such as begin_offset) is calculated based on the UTF-16 encoding of the input. Java and JavaScript are examples of languages that use this encoding natively.

UTF32 (3):

Encoding-dependent information (such as begin_offset) is calculated based on the UTF-32 encoding of the input. Python is an example of a language that uses this encoding natively.

class google.cloud.language_v1beta2.types.Entity(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as salience and mentions, with entities.

name

The representative name for the entity.

Type

str

type_

The entity type.

Type

google.cloud.language_v1beta2.types.Entity.Type

metadata

Metadata associated with the entity.

For most entity types, the metadata is a Wikipedia URL (wikipedia_url) and Knowledge Graph MID (mid), if they are available. For the metadata associated with other entity types, see the Type table below.

Type

MutableMapping[str, str]

salience

The salience score associated with the entity in the [0, 1.0] range.

The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.

Type

float

mentions

The mentions of this entity in the input document. The API currently supports proper noun mentions.

Type

MutableSequence[google.cloud.language_v1beta2.types.EntityMention]

sentiment

For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.

Type

google.cloud.language_v1beta2.types.Sentiment

class MetadataEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class Type(value)[source]

Bases: proto.enums.Enum

The type of the entity. For most entity types, the associated metadata is a Wikipedia URL (wikipedia_url) and Knowledge Graph MID (mid). The table below lists the associated fields for entities that have different metadata.

Values:
UNKNOWN (0):

Unknown

PERSON (1):

Person

LOCATION (2):

Location

ORGANIZATION (3):

Organization

EVENT (4):

Event

WORK_OF_ART (5):

Artwork

CONSUMER_GOOD (6):

Consumer product

OTHER (7):

Other types of entities

PHONE_NUMBER (9):

Phone number

The metadata lists the phone number, formatted according to local convention, plus whichever additional elements appear in the text:

  • number - the actual number, broken down into sections as per local convention

  • national_prefix - country code, if detected

  • area_code - region or area code, if detected

  • extension - phone extension (to be dialed after connection), if detected

ADDRESS (10):

Address

The metadata identifies the street number and locality plus whichever additional elements appear in the text:

  • street_number - street number

  • locality - city or town

  • street_name - street/route name, if detected

  • postal_code - postal code, if detected

  • country - country, if detected<

  • broad_region - administrative area, such as the state, if detected

  • narrow_region - smaller administrative area, such as county, if detected

  • sublocality - used in Asian addresses to demark a district within a city, if detected

DATE (11):

Date

The metadata identifies the components of the date:

  • year - four digit year, if detected

  • month - two digit month number, if detected

  • day - two digit day number, if detected

NUMBER (12):

Number The metadata is the number itself.

PRICE (13):

Price

The metadata identifies the value and currency.

class google.cloud.language_v1beta2.types.EntityMention(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents a mention for an entity in the text. Currently, proper noun mentions are supported.

text

The mention text.

Type

google.cloud.language_v1beta2.types.TextSpan

type_

The type of the entity mention.

Type

google.cloud.language_v1beta2.types.EntityMention.Type

sentiment

For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the sentiment expressed for this mention of the entity in the provided document.

Type

google.cloud.language_v1beta2.types.Sentiment

class Type(value)[source]

Bases: proto.enums.Enum

The supported types of mentions.

Values:
TYPE_UNKNOWN (0):

Unknown

PROPER (1):

Proper name

COMMON (2):

Common noun (or noun compound)

class google.cloud.language_v1beta2.types.ModerateTextRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The document moderation request message.

document

Required. Input document.

Type

google.cloud.language_v1beta2.types.Document

class google.cloud.language_v1beta2.types.ModerateTextResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The document moderation response message.

moderation_categories

Harmful and sensitive categories representing the input document.

Type

MutableSequence[google.cloud.language_v1beta2.types.ClassificationCategory]

class google.cloud.language_v1beta2.types.PartOfSpeech(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents part of speech information for a token.

tag

The part of speech tag.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Tag

aspect

The grammatical aspect.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Aspect

case

The grammatical case.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Case

form

The grammatical form.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Form

gender

The grammatical gender.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Gender

mood

The grammatical mood.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Mood

number

The grammatical number.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Number

person

The grammatical person.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Person

proper

The grammatical properness.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Proper

reciprocity

The grammatical reciprocity.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Reciprocity

tense

The grammatical tense.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Tense

voice

The grammatical voice.

Type

google.cloud.language_v1beta2.types.PartOfSpeech.Voice

class Aspect(value)[source]

Bases: proto.enums.Enum

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

Values:
ASPECT_UNKNOWN (0):

Aspect is not applicable in the analyzed language or is not predicted.

PERFECTIVE (1):

Perfective

IMPERFECTIVE (2):

Imperfective

PROGRESSIVE (3):

Progressive

class Case(value)[source]

Bases: proto.enums.Enum

The grammatical function performed by a noun or pronoun in a phrase, clause, or sentence. In some languages, other parts of speech, such as adjective and determiner, take case inflection in agreement with the noun.

Values:
CASE_UNKNOWN (0):

Case is not applicable in the analyzed language or is not predicted.

ACCUSATIVE (1):

Accusative

ADVERBIAL (2):

Adverbial

COMPLEMENTIVE (3):

Complementive

DATIVE (4):

Dative

GENITIVE (5):

Genitive

INSTRUMENTAL (6):

Instrumental

LOCATIVE (7):

Locative

NOMINATIVE (8):

Nominative

OBLIQUE (9):

Oblique

PARTITIVE (10):

Partitive

PREPOSITIONAL (11):

Prepositional

REFLEXIVE_CASE (12):

Reflexive

RELATIVE_CASE (13):

Relative

VOCATIVE (14):

Vocative

class Form(value)[source]

Bases: proto.enums.Enum

Depending on the language, Form can be categorizing different forms of verbs, adjectives, adverbs, etc. For example, categorizing inflected endings of verbs and adjectives or distinguishing between short and long forms of adjectives and participles

Values:
FORM_UNKNOWN (0):

Form is not applicable in the analyzed language or is not predicted.

ADNOMIAL (1):

Adnomial

AUXILIARY (2):

Auxiliary

COMPLEMENTIZER (3):

Complementizer

FINAL_ENDING (4):

Final ending

GERUND (5):

Gerund

REALIS (6):

Realis

IRREALIS (7):

Irrealis

SHORT (8):

Short form

LONG (9):

Long form

ORDER (10):

Order form

SPECIFIC (11):

Specific form

class Gender(value)[source]

Bases: proto.enums.Enum

Gender classes of nouns reflected in the behaviour of associated words.

Values:
GENDER_UNKNOWN (0):

Gender is not applicable in the analyzed language or is not predicted.

FEMININE (1):

Feminine

MASCULINE (2):

Masculine

NEUTER (3):

Neuter

class Mood(value)[source]

Bases: proto.enums.Enum

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

Values:
MOOD_UNKNOWN (0):

Mood is not applicable in the analyzed language or is not predicted.

CONDITIONAL_MOOD (1):

Conditional

IMPERATIVE (2):

Imperative

INDICATIVE (3):

Indicative

INTERROGATIVE (4):

Interrogative

JUSSIVE (5):

Jussive

SUBJUNCTIVE (6):

Subjunctive

class Number(value)[source]

Bases: proto.enums.Enum

Count distinctions.

Values:
NUMBER_UNKNOWN (0):

Number is not applicable in the analyzed language or is not predicted.

SINGULAR (1):

Singular

PLURAL (2):

Plural

DUAL (3):

Dual

class Person(value)[source]

Bases: proto.enums.Enum

The distinction between the speaker, second person, third person, etc.

Values:
PERSON_UNKNOWN (0):

Person is not applicable in the analyzed language or is not predicted.

FIRST (1):

First

SECOND (2):

Second

THIRD (3):

Third

REFLEXIVE_PERSON (4):

Reflexive

class Proper(value)[source]

Bases: proto.enums.Enum

This category shows if the token is part of a proper name.

Values:
PROPER_UNKNOWN (0):

Proper is not applicable in the analyzed language or is not predicted.

PROPER (1):

Proper

NOT_PROPER (2):

Not proper

class Reciprocity(value)[source]

Bases: proto.enums.Enum

Reciprocal features of a pronoun.

Values:
RECIPROCITY_UNKNOWN (0):

Reciprocity is not applicable in the analyzed language or is not predicted.

RECIPROCAL (1):

Reciprocal

NON_RECIPROCAL (2):

Non-reciprocal

class Tag(value)[source]

Bases: proto.enums.Enum

The part of speech tags enum.

Values:
UNKNOWN (0):

Unknown

ADJ (1):

Adjective

ADP (2):

Adposition (preposition and postposition)

ADV (3):

Adverb

CONJ (4):

Conjunction

DET (5):

Determiner

NOUN (6):

Noun (common and proper)

NUM (7):

Cardinal number

PRON (8):

Pronoun

PRT (9):

Particle or other function word

PUNCT (10):

Punctuation

VERB (11):

Verb (all tenses and modes)

X (12):

Other: foreign words, typos, abbreviations

AFFIX (13):

Affix

class Tense(value)[source]

Bases: proto.enums.Enum

Time reference.

Values:
TENSE_UNKNOWN (0):

Tense is not applicable in the analyzed language or is not predicted.

CONDITIONAL_TENSE (1):

Conditional

FUTURE (2):

Future

PAST (3):

Past

PRESENT (4):

Present

IMPERFECT (5):

Imperfect

PLUPERFECT (6):

Pluperfect

class Voice(value)[source]

Bases: proto.enums.Enum

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

Values:
VOICE_UNKNOWN (0):

Voice is not applicable in the analyzed language or is not predicted.

ACTIVE (1):

Active

CAUSATIVE (2):

Causative

PASSIVE (3):

Passive

class google.cloud.language_v1beta2.types.Sentence(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents a sentence in the input document.

text

The sentence text.

Type

google.cloud.language_v1beta2.types.TextSpan

sentiment

For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.

Type

google.cloud.language_v1beta2.types.Sentiment

class google.cloud.language_v1beta2.types.Sentiment(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents the feeling associated with the entire text or entities in the text. Next ID: 6

magnitude

A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).

Type

float

score

Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).

Type

float

class google.cloud.language_v1beta2.types.TextSpan(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents an output piece of text.

content

The content of the output text.

Type

str

begin_offset

The API calculates the beginning offset of the content in the original document according to the [EncodingType][google.cloud.language.v1beta2.EncodingType] specified in the API request.

Type

int

class google.cloud.language_v1beta2.types.Token(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents the smallest syntactic building block of the text.

text

The token text.

Type

google.cloud.language_v1beta2.types.TextSpan

part_of_speech

Parts of speech tag for this token.

Type

google.cloud.language_v1beta2.types.PartOfSpeech

dependency_edge

Dependency tree parse for this token.

Type

google.cloud.language_v1beta2.types.DependencyEdge

lemma

Lemma of the token.

Type

str