Types for Google Cloud Language v1 API¶
- class google.cloud.language_v1.types.AnalyzeEntitiesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The entity analysis request message.
- document¶
Required. Input document.
- encoding_type¶
The encoding type used by the API to calculate offsets.
- class google.cloud.language_v1.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_v1.types.Entity]
- class google.cloud.language_v1.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.
- encoding_type¶
The encoding type used by the API to calculate offsets.
- class google.cloud.language_v1.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_v1.types.Entity]
- class google.cloud.language_v1.types.AnalyzeSentimentRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The sentiment analysis request message.
- document¶
Required. Input document.
- encoding_type¶
The encoding type used by the API to calculate sentence offsets.
- class google.cloud.language_v1.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.
- 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.v1.Document.language] field for more details.
- Type
- sentences¶
The sentiment for all the sentences in the document.
- Type
MutableSequence[google.cloud.language_v1.types.Sentence]
- class google.cloud.language_v1.types.AnalyzeSyntaxRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The syntax analysis request message.
- document¶
Required. Input document.
- encoding_type¶
The encoding type used by the API to calculate offsets.
- class google.cloud.language_v1.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_v1.types.Sentence]
- tokens¶
Tokens, along with their syntactic information, in the input document.
- Type
MutableSequence[google.cloud.language_v1.types.Token]
- class google.cloud.language_v1.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.
- features¶
Required. The enabled features.
- encoding_type¶
The encoding type used by the API to calculate offsets.
- 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.
- 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.
- class google.cloud.language_v1.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.v1.AnnotateTextRequest.Features.extract_syntax].
- Type
MutableSequence[google.cloud.language_v1.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.v1.AnnotateTextRequest.Features.extract_syntax].
- Type
MutableSequence[google.cloud.language_v1.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.v1.AnnotateTextRequest.Features.extract_entities].
- Type
MutableSequence[google.cloud.language_v1.types.Entity]
- document_sentiment¶
The overall sentiment for the document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_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.v1.Document.language] field for more details.
- Type
- categories¶
Categories identified in the input document.
- Type
MutableSequence[google.cloud.language_v1.types.ClassificationCategory]
- moderation_categories¶
Harmful and sensitive categories identified in the input document.
- Type
MutableSequence[google.cloud.language_v1.types.ClassificationCategory]
- class google.cloud.language_v1.types.ClassificationCategory(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Represents a category returned from the text classifier.
- class google.cloud.language_v1.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
.
- 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
.
- 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.
- 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 toV1
.- V1 (1):
Legacy content categories of our initial launch in 2017.
- V2 (2):
Updated content categories in 2022.
- class google.cloud.language_v1.types.ClassifyTextRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The document classification request message.
- document¶
Required. Input document.
- classification_model_options¶
Model options to use for classification. Defaults to v1 options if not specified.
- class google.cloud.language_v1.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_v1.types.ClassificationCategory]
- class google.cloud.language_v1.types.DependencyEdge(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Represents dependency parse tree information for a token. (For more information on dependency labels, see http://www.aclweb.org/anthology/P13-2017
- 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
- label¶
The parse label for the token.
- 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_v1.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 anINVALID_ARGUMENT
error.
- 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
- 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
- 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
- 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_v1.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 asbegin_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_v1.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.
- type_¶
The 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.
- 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
- mentions¶
The mentions of this entity in the input document. The API currently supports proper noun mentions.
- Type
MutableSequence[google.cloud.language_v1.types.EntityMention]
- sentiment¶
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.
- 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 conventionnational_prefix
- country code, if detectedarea_code
- region or area code, if detectedextension
- 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 numberlocality
- city or townstreet_name
- street/route name, if detectedpostal_code
- postal code, if detectedcountry
- country, if detected<broad_region
- administrative area, such as the state, if detectednarrow_region
- smaller administrative area, such as county, if detectedsublocality
- 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 detectedmonth
- two digit month number, if detectedday
- two digit day number, if detected
- NUMBER (12):
Number
The metadata is the number itself.
- PRICE (13):
Price
The metadata identifies the
value
andcurrency
.
- class google.cloud.language_v1.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_¶
The type of the entity mention.
- sentiment¶
For calls to [AnalyzeEntitySentiment][] or if [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.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.
- 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_v1.types.ModerateTextRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The document moderation request message.
- document¶
Required. Input document.
- class google.cloud.language_v1.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_v1.types.ClassificationCategory]
- class google.cloud.language_v1.types.PartOfSpeech(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Represents part of speech information for a token. Parts of speech are as defined in http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
- tag¶
The part of speech tag.
- aspect¶
The grammatical aspect.
- case¶
The grammatical case.
- form¶
The grammatical form.
- gender¶
The grammatical gender.
- mood¶
The grammatical mood.
- number¶
The grammatical number.
- person¶
The grammatical person.
- proper¶
The grammatical properness.
- reciprocity¶
The grammatical reciprocity.
- tense¶
The grammatical tense.
- voice¶
The grammatical 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_v1.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.
- sentiment¶
For calls to [AnalyzeSentiment][] or if [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to true, this field will contain the sentiment for the sentence.
- class google.cloud.language_v1.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.
- magnitude¶
A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment regardless of score (positive or negative).
- Type
- class google.cloud.language_v1.types.TextSpan(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Represents an output piece of text.
- class google.cloud.language_v1.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.
- part_of_speech¶
Parts of speech tag for this token.
- dependency_edge¶
Dependency tree parse for this token.