Service Client: Google::Cloud::Language::V1beta1::LanguageService::LanguageServiceClient

Client stub representing the remote LanguageService gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to language.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Cloud::Language::V1beta1::LanguageService - Compiled Protocol Buffers messages for google/cloud/language/v1beta1/language_service.proto

SYNOPSIS

use Google::Cloud::Language::V1beta1::LanguageService;

my $msg = Google::Cloud::Language::V1beta1::LanguageService::Document->new({
    type => $type,
    content => $content,
    gcs_content_uri => $gcs_content_uri,
    language => $language,
});

# Read or update a field
my $val = $msg->type();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Language::V1beta1::LanguageService::Document->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/language/v1beta1/language_service.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Language::V1beta1::LanguageService::Document

Represents the input to API methods.

Inherits from Protobuf::Message.

Accessors

  • $msg->type() / $msg->type($value)

    Type: Enum (Google::Cloud::Language::V1beta1::Document::Type)

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

  • $msg->content() / $msg->content($value)

    Type: String

    The content of the input in string format.

  • $msg->gcs_content_uri() / $msg->gcs_content_uri($value)

    Type: String

    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.

  • $msg->language() / $msg->language($value)

    Type: String

    The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.<br> [Language Support](https://cloud.google.com/natural-language/docs/languages) 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.

Enum: Document::Type

  • TYPE_UNSPECIFIED => 0

  • PLAIN_TEXT => 1

  • HTML => 2

Google::Cloud::Language::V1beta1::LanguageService::Sentence

Represents a sentence in the input document.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Language::V1beta1::LanguageService::Entity

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.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    The representative name for the entity.

  • $msg->type() / $msg->type($value)

    Type: Enum (Google::Cloud::Language::V1beta1::Entity::Type)

    The entity type.

  • $msg->metadata() / $msg->metadata($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Entity::MetadataEntry)

    Metadata associated with the entity.

    Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.

  • $msg->salience() / $msg->salience($value)

    Type: Float

    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.

  • $msg->mentions() / $msg->mentions($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::EntityMention)

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

Enum: Entity::Type

  • UNKNOWN => 0

  • PERSON => 1

  • LOCATION => 2

  • ORGANIZATION => 3

  • EVENT => 4

  • WORK_OF_ART => 5

  • CONSUMER_GOOD => 6

  • OTHER => 7

Google::Cloud::Language::V1beta1::LanguageService::Token

Represents the smallest syntactic building block of the text.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Language::V1beta1::LanguageService::Sentiment

Represents the feeling associated with the entire text or entities in the text.

Inherits from Protobuf::Message.

Accessors

  • $msg->polarity() / $msg->polarity($value)

    Type: Float

    DEPRECATED FIELD - This field is being deprecated in favor of score. Please refer to our documentation at https://cloud.google.com/natural-language/docs for more information.

  • $msg->magnitude() / $msg->magnitude($value)

    Type: Float

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

  • $msg->score() / $msg->score($value)

    Type: Float

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

Google::Cloud::Language::V1beta1::LanguageService::PartOfSpeech

Represents part of speech information for a token.

Inherits from Protobuf::Message.

Accessors

Enum: PartOfSpeech::Tag

  • UNKNOWN => 0

  • ADJ => 1

  • ADP => 2

  • ADV => 3

  • CONJ => 4

  • DET => 5

  • NOUN => 6

  • NUM => 7

  • PRON => 8

  • PRT => 9

  • PUNCT => 10

  • VERB => 11

  • X => 12

  • AFFIX => 13

Enum: PartOfSpeech::Aspect

  • ASPECT_UNKNOWN => 0

  • PERFECTIVE => 1

  • IMPERFECTIVE => 2

  • PROGRESSIVE => 3

Enum: PartOfSpeech::Case

  • CASE_UNKNOWN => 0

  • ACCUSATIVE => 1

  • ADVERBIAL => 2

  • COMPLEMENTIVE => 3

  • DATIVE => 4

  • GENITIVE => 5

  • INSTRUMENTAL => 6

  • LOCATIVE => 7

  • NOMINATIVE => 8

  • OBLIQUE => 9

  • PARTITIVE => 10

  • PREPOSITIONAL => 11

  • REFLEXIVE_CASE => 12

  • RELATIVE_CASE => 13

  • VOCATIVE => 14

Enum: PartOfSpeech::Form

  • FORM_UNKNOWN => 0

  • ADNOMIAL => 1

  • AUXILIARY => 2

  • COMPLEMENTIZER => 3

  • FINAL_ENDING => 4

  • GERUND => 5

  • REALIS => 6

  • IRREALIS => 7

  • SHORT => 8

  • LONG => 9

  • ORDER => 10

  • SPECIFIC => 11

Enum: PartOfSpeech::Gender

  • GENDER_UNKNOWN => 0

  • FEMININE => 1

  • MASCULINE => 2

  • NEUTER => 3

Enum: PartOfSpeech::Mood

  • MOOD_UNKNOWN => 0

  • CONDITIONAL_MOOD => 1

  • IMPERATIVE => 2

  • INDICATIVE => 3

  • INTERROGATIVE => 4

  • JUSSIVE => 5

  • SUBJUNCTIVE => 6

Enum: PartOfSpeech::Number

  • NUMBER_UNKNOWN => 0

  • SINGULAR => 1

  • PLURAL => 2

  • DUAL => 3

Enum: PartOfSpeech::Person

  • PERSON_UNKNOWN => 0

  • FIRST => 1

  • SECOND => 2

  • THIRD => 3

  • REFLEXIVE_PERSON => 4

Enum: PartOfSpeech::Proper

  • PROPER_UNKNOWN => 0

  • PROPER => 1

  • NOT_PROPER => 2

Enum: PartOfSpeech::Reciprocity

  • RECIPROCITY_UNKNOWN => 0

  • RECIPROCAL => 1

  • NON_RECIPROCAL => 2

Enum: PartOfSpeech::Tense

  • TENSE_UNKNOWN => 0

  • CONDITIONAL_TENSE => 1

  • FUTURE => 2

  • PAST => 3

  • PRESENT => 4

  • IMPERFECT => 5

  • PLUPERFECT => 6

Enum: PartOfSpeech::Voice

  • VOICE_UNKNOWN => 0

  • ACTIVE => 1

  • CAUSATIVE => 2

  • PASSIVE => 3

Google::Cloud::Language::V1beta1::LanguageService::DependencyEdge

Represents dependency parse tree information for a token.

Inherits from Protobuf::Message.

Accessors

  • $msg->head_token_index() / $msg->head_token_index($value)

    Type: Int32

    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.

  • $msg->label() / $msg->label($value)

    Type: Enum (Google::Cloud::Language::V1beta1::DependencyEdge::Label)

    The parse label for the token.

Enum: DependencyEdge::Label

  • UNKNOWN => 0

  • ABBREV => 1

  • ACOMP => 2

  • ADVCL => 3

  • ADVMOD => 4

  • AMOD => 5

  • APPOS => 6

  • ATTR => 7

  • AUX => 8

  • AUXPASS => 9

  • CC => 10

  • CCOMP => 11

  • CONJ => 12

  • CSUBJ => 13

  • CSUBJPASS => 14

  • DEP => 15

  • DET => 16

  • DISCOURSE => 17

  • DOBJ => 18

  • EXPL => 19

  • GOESWITH => 20

  • IOBJ => 21

  • MARK => 22

  • MWE => 23

  • MWV => 24

  • NEG => 25

  • NN => 26

  • NPADVMOD => 27

  • NSUBJ => 28

  • NSUBJPASS => 29

  • NUM => 30

  • NUMBER => 31

  • P => 32

  • PARATAXIS => 33

  • PARTMOD => 34

  • PCOMP => 35

  • POBJ => 36

  • POSS => 37

  • POSTNEG => 38

  • PRECOMP => 39

  • PRECONJ => 40

  • PREDET => 41

  • PREF => 42

  • PREP => 43

  • PRONL => 44

  • PRT => 45

  • PS => 46

  • QUANTMOD => 47

  • RCMOD => 48

  • RCMODREL => 49

  • RDROP => 50

  • REF => 51

  • REMNANT => 52

  • REPARANDUM => 53

  • ROOT => 54

  • SNUM => 55

  • SUFF => 56

  • TMOD => 57

  • TOPIC => 58

  • VMOD => 59

  • VOCATIVE => 60

  • XCOMP => 61

  • SUFFIX => 62

  • TITLE => 63

  • ADVPHMOD => 64

  • AUXCAUS => 65

  • AUXVV => 66

  • DTMOD => 67

  • FOREIGN => 68

  • KW => 69

  • LIST => 70

  • NOMC => 71

  • NOMCSUBJ => 72

  • NOMCSUBJPASS => 73

  • NUMC => 74

  • COP => 75

  • DISLOCATED => 76

Google::Cloud::Language::V1beta1::LanguageService::EntityMention

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

Inherits from Protobuf::Message.

Accessors

Enum: EntityMention::Type

  • TYPE_UNKNOWN => 0

  • PROPER => 1

  • COMMON => 2

Google::Cloud::Language::V1beta1::LanguageService::TextSpan

Represents an output piece of text.

Inherits from Protobuf::Message.

Accessors

  • $msg->content() / $msg->content($value)

    Type: String

    The content of the output text.

  • $msg->begin_offset() / $msg->begin_offset($value)

    Type: Int32

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

Google::Cloud::Language::V1beta1::LanguageService::AnalyzeSentimentRequest

The sentiment analysis request message.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Language::V1beta1::LanguageService::AnalyzeSentimentResponse

The sentiment analysis response message.

Inherits from Protobuf::Message.

Accessors

  • $msg->document_sentiment() / $msg->document_sentiment($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Sentiment)

    The overall sentiment of the input document.

  • $msg->language() / $msg->language($value)

    Type: String

    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.v1beta1.Document.language] field for more details.

  • $msg->sentences() / $msg->sentences($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Sentence)

    The sentiment for all the sentences in the document.

Google::Cloud::Language::V1beta1::LanguageService::AnalyzeEntitiesRequest

The entity analysis request message.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Language::V1beta1::LanguageService::AnalyzeEntitiesResponse

The entity analysis response message.

Inherits from Protobuf::Message.

Accessors

  • $msg->entities() / $msg->entities($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Entity)

    The recognized entities in the input document.

  • $msg->language() / $msg->language($value)

    Type: String

    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.v1beta1.Document.language] field for more details.

Google::Cloud::Language::V1beta1::LanguageService::AnalyzeSyntaxRequest

The syntax analysis request message.

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Language::V1beta1::LanguageService::AnalyzeSyntaxResponse

The syntax analysis response message.

Inherits from Protobuf::Message.

Accessors

  • $msg->sentences() / $msg->sentences($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Sentence)

    Sentences in the input document.

  • $msg->tokens() / $msg->tokens($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Token)

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

  • $msg->language() / $msg->language($value)

    Type: String

    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.v1beta1.Document.language] field for more details.

Google::Cloud::Language::V1beta1::LanguageService::AnnotateTextRequest

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

Inherits from Protobuf::Message.

Accessors

Google::Cloud::Language::V1beta1::LanguageService::AnnotateTextResponse

The text annotations response message.

Inherits from Protobuf::Message.

Accessors

  • $msg->sentences() / $msg->sentences($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Sentence)

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

  • $msg->tokens() / $msg->tokens($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Token)

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

  • $msg->entities() / $msg->entities($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Entity)

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

  • $msg->document_sentiment() / $msg->document_sentiment($value)

    Type: Message (Google::Cloud::Language::V1beta1::LanguageService::Sentiment)

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

  • $msg->language() / $msg->language($value)

    Type: String

    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.v1beta1.Document.language] field for more details.

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Language::V1beta1::LanguageService::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.