Service Client: Google::Cloud::Language::V1beta2::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::V1beta2::LanguageService - Compiled Protocol Buffers messages for google/cloud/language/v1beta2/language_service.proto
SYNOPSIS
use Google::Cloud::Language::V1beta2::LanguageService;
my $msg = Google::Cloud::Language::V1beta2::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::V1beta2::LanguageService::Document->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/language/v1beta2/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::V1beta2::LanguageService::Document
Represents the input to API methods.
Inherits from Protobuf::Message.
Accessors
$msg->type()/$msg->type($value)Type:
Enum(Google::Cloud::Language::V1beta2::Document::Type)Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.
$msg->content()/$msg->content($value)Type:
StringThe content of the input in string format. Cloud audit logging exempt since it is based on user data.
$msg->gcs_content_uri()/$msg->gcs_content_uri($value)Type:
StringThe 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:
StringThe 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.
$msg->reference_web_uri()/$msg->reference_web_uri($value)Type:
StringThe web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
$msg->boilerplate_handling()/$msg->boilerplate_handling($value)Type:
Enum(Google::Cloud::Language::V1beta2::Document::BoilerplateHandling)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.
Enum: Document::Type
TYPE_UNSPECIFIED=>0PLAIN_TEXT=>1HTML=>2
Enum: Document::BoilerplateHandling
BOILERPLATE_HANDLING_UNSPECIFIED=>0SKIP_BOILERPLATE=>1KEEP_BOILERPLATE=>2
Google::Cloud::Language::V1beta2::LanguageService::Sentence
Represents a sentence in the input document.
Inherits from Protobuf::Message.
Accessors
$msg->text()/$msg->text($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::TextSpan)The sentence text.
$msg->sentiment()/$msg->sentiment($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::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.
Google::Cloud::Language::V1beta2::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:
StringThe representative name for the entity.
$msg->type()/$msg->type($value)Type:
Enum(Google::Cloud::Language::V1beta2::Entity::Type)The entity type.
$msg->metadata()/$msg->metadata($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Entity::MetadataEntry)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.
$msg->salience()/$msg->salience($value)Type:
FloatThe 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::V1beta2::LanguageService::EntityMention)The mentions of this entity in the input document. The API currently supports proper noun mentions.
$msg->sentiment()/$msg->sentiment($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::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.
Enum: Entity::Type
UNKNOWN=>0PERSON=>1LOCATION=>2ORGANIZATION=>3EVENT=>4WORK_OF_ART=>5CONSUMER_GOOD=>6OTHER=>7PHONE_NUMBER=>9ADDRESS=>10DATE=>11NUMBER=>12PRICE=>13
Google::Cloud::Language::V1beta2::LanguageService::Token
Represents the smallest syntactic building block of the text.
Inherits from Protobuf::Message.
Accessors
$msg->text()/$msg->text($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::TextSpan)The token text.
$msg->part_of_speech()/$msg->part_of_speech($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::PartOfSpeech)Parts of speech tag for this token.
$msg->dependency_edge()/$msg->dependency_edge($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::DependencyEdge)Dependency tree parse for this token.
$msg->lemma()/$msg->lemma($value)Type:
String[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
Google::Cloud::Language::V1beta2::LanguageService::Sentiment
Represents the feeling associated with the entire text or entities in the text. Next ID: 6
Inherits from Protobuf::Message.
Accessors
$msg->magnitude()/$msg->magnitude($value)Type:
FloatA 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:
FloatSentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
Google::Cloud::Language::V1beta2::LanguageService::PartOfSpeech
Represents part of speech information for a token.
Inherits from Protobuf::Message.
Accessors
$msg->tag()/$msg->tag($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Tag)The part of speech tag.
$msg->aspect()/$msg->aspect($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Aspect)The grammatical aspect.
$msg->case()/$msg->case($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Case)The grammatical case.
$msg->form()/$msg->form($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Form)The grammatical form.
$msg->gender()/$msg->gender($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Gender)The grammatical gender.
$msg->mood()/$msg->mood($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Mood)The grammatical mood.
$msg->number()/$msg->number($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Number)The grammatical number.
$msg->person()/$msg->person($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Person)The grammatical person.
$msg->proper()/$msg->proper($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Proper)The grammatical properness.
$msg->reciprocity()/$msg->reciprocity($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Reciprocity)The grammatical reciprocity.
$msg->tense()/$msg->tense($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Tense)The grammatical tense.
$msg->voice()/$msg->voice($value)Type:
Enum(Google::Cloud::Language::V1beta2::PartOfSpeech::Voice)The grammatical voice.
Enum: PartOfSpeech::Tag
UNKNOWN=>0ADJ=>1ADP=>2ADV=>3CONJ=>4DET=>5NOUN=>6NUM=>7PRON=>8PRT=>9PUNCT=>10VERB=>11X=>12AFFIX=>13
Enum: PartOfSpeech::Aspect
ASPECT_UNKNOWN=>0PERFECTIVE=>1IMPERFECTIVE=>2PROGRESSIVE=>3
Enum: PartOfSpeech::Case
CASE_UNKNOWN=>0ACCUSATIVE=>1ADVERBIAL=>2COMPLEMENTIVE=>3DATIVE=>4GENITIVE=>5INSTRUMENTAL=>6LOCATIVE=>7NOMINATIVE=>8OBLIQUE=>9PARTITIVE=>10PREPOSITIONAL=>11REFLEXIVE_CASE=>12RELATIVE_CASE=>13VOCATIVE=>14
Enum: PartOfSpeech::Form
FORM_UNKNOWN=>0ADNOMIAL=>1AUXILIARY=>2COMPLEMENTIZER=>3FINAL_ENDING=>4GERUND=>5REALIS=>6IRREALIS=>7SHORT=>8LONG=>9ORDER=>10SPECIFIC=>11
Enum: PartOfSpeech::Gender
GENDER_UNKNOWN=>0FEMININE=>1MASCULINE=>2NEUTER=>3
Enum: PartOfSpeech::Mood
MOOD_UNKNOWN=>0CONDITIONAL_MOOD=>1IMPERATIVE=>2INDICATIVE=>3INTERROGATIVE=>4JUSSIVE=>5SUBJUNCTIVE=>6
Enum: PartOfSpeech::Number
NUMBER_UNKNOWN=>0SINGULAR=>1PLURAL=>2DUAL=>3
Enum: PartOfSpeech::Person
PERSON_UNKNOWN=>0FIRST=>1SECOND=>2THIRD=>3REFLEXIVE_PERSON=>4
Enum: PartOfSpeech::Proper
PROPER_UNKNOWN=>0PROPER=>1NOT_PROPER=>2
Enum: PartOfSpeech::Reciprocity
RECIPROCITY_UNKNOWN=>0RECIPROCAL=>1NON_RECIPROCAL=>2
Enum: PartOfSpeech::Tense
TENSE_UNKNOWN=>0CONDITIONAL_TENSE=>1FUTURE=>2PAST=>3PRESENT=>4IMPERFECT=>5PLUPERFECT=>6
Enum: PartOfSpeech::Voice
VOICE_UNKNOWN=>0ACTIVE=>1CAUSATIVE=>2PASSIVE=>3
Google::Cloud::Language::V1beta2::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:
Int32Represents 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::V1beta2::DependencyEdge::Label)The parse label for the token.
Enum: DependencyEdge::Label
UNKNOWN=>0ABBREV=>1ACOMP=>2ADVCL=>3ADVMOD=>4AMOD=>5APPOS=>6ATTR=>7AUX=>8AUXPASS=>9CC=>10CCOMP=>11CONJ=>12CSUBJ=>13CSUBJPASS=>14DEP=>15DET=>16DISCOURSE=>17DOBJ=>18EXPL=>19GOESWITH=>20IOBJ=>21MARK=>22MWE=>23MWV=>24NEG=>25NN=>26NPADVMOD=>27NSUBJ=>28NSUBJPASS=>29NUM=>30NUMBER=>31P=>32PARATAXIS=>33PARTMOD=>34PCOMP=>35POBJ=>36POSS=>37POSTNEG=>38PRECOMP=>39PRECONJ=>40PREDET=>41PREF=>42PREP=>43PRONL=>44PRT=>45PS=>46QUANTMOD=>47RCMOD=>48RCMODREL=>49RDROP=>50REF=>51REMNANT=>52REPARANDUM=>53ROOT=>54SNUM=>55SUFF=>56TMOD=>57TOPIC=>58VMOD=>59VOCATIVE=>60XCOMP=>61SUFFIX=>62TITLE=>63ADVPHMOD=>64AUXCAUS=>65AUXVV=>66DTMOD=>67FOREIGN=>68KW=>69LIST=>70NOMC=>71NOMCSUBJ=>72NOMCSUBJPASS=>73NUMC=>74COP=>75DISLOCATED=>76ASP=>77GMOD=>78GOBJ=>79INFMOD=>80MES=>81NCOMP=>82
Google::Cloud::Language::V1beta2::LanguageService::EntityMention
Represents a mention for an entity in the text. Currently, proper noun mentions are supported.
Inherits from Protobuf::Message.
Accessors
$msg->text()/$msg->text($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::TextSpan)The mention text.
$msg->type()/$msg->type($value)Type:
Enum(Google::Cloud::Language::V1beta2::EntityMention::Type)The type of the entity mention.
$msg->sentiment()/$msg->sentiment($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::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.
Enum: EntityMention::Type
TYPE_UNKNOWN=>0PROPER=>1COMMON=>2
Google::Cloud::Language::V1beta2::LanguageService::TextSpan
Represents an output piece of text.
Inherits from Protobuf::Message.
Accessors
$msg->content()/$msg->content($value)Type:
StringThe content of the output text.
$msg->begin_offset()/$msg->begin_offset($value)Type:
Int32The 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.
Google::Cloud::Language::V1beta2::LanguageService::ClassificationCategory
Represents a category returned from the text classifier.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringThe name of the category representing the document.
$msg->confidence()/$msg->confidence($value)Type:
FloatThe classifier's confidence of the category. Number represents how certain the classifier is that this category represents the given text.
Google::Cloud::Language::V1beta2::LanguageService::ClassificationModelOptions
Model options available for classification requests.
Inherits from Protobuf::Message.
Accessors
$msg->v1_model()/$msg->v1_model($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::ClassificationModelOptions::V1Model)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.
$msg->v2_model()/$msg->v2_model($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::ClassificationModelOptions::V2Model)Setting this field will use the V2 model with the appropriate content categories version. The V2 model is a better performing model.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeSentimentRequest
The sentiment analysis request message.
Inherits from Protobuf::Message.
Accessors
$msg->document()/$msg->document($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Document)Required. Input document.
$msg->encoding_type()/$msg->encoding_type($value)Type:
Enum(Google::Cloud::Language::V1beta2::EncodingType)The encoding type used by the API to calculate sentence offsets for the sentence sentiment.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeSentimentResponse
The sentiment analysis response message.
Inherits from Protobuf::Message.
Accessors
$msg->document_sentiment()/$msg->document_sentiment($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Sentiment)The overall sentiment of the input document.
$msg->language()/$msg->language($value)Type:
StringThe 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.
$msg->sentences()/$msg->sentences($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Sentence)The sentiment for all the sentences in the document.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeEntitySentimentRequest
The entity-level sentiment analysis request message.
Inherits from Protobuf::Message.
Accessors
$msg->document()/$msg->document($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Document)Required. Input document.
$msg->encoding_type()/$msg->encoding_type($value)Type:
Enum(Google::Cloud::Language::V1beta2::EncodingType)The encoding type used by the API to calculate offsets.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeEntitySentimentResponse
The entity-level sentiment analysis response message.
Inherits from Protobuf::Message.
Accessors
$msg->entities()/$msg->entities($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Entity)The recognized entities in the input document with associated sentiments.
$msg->language()/$msg->language($value)Type:
StringThe 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.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeEntitiesRequest
The entity analysis request message.
Inherits from Protobuf::Message.
Accessors
$msg->document()/$msg->document($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Document)Required. Input document.
$msg->encoding_type()/$msg->encoding_type($value)Type:
Enum(Google::Cloud::Language::V1beta2::EncodingType)The encoding type used by the API to calculate offsets.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeEntitiesResponse
The entity analysis response message.
Inherits from Protobuf::Message.
Accessors
$msg->entities()/$msg->entities($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Entity)The recognized entities in the input document.
$msg->language()/$msg->language($value)Type:
StringThe 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.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeSyntaxRequest
The syntax analysis request message.
Inherits from Protobuf::Message.
Accessors
$msg->document()/$msg->document($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Document)Required. Input document.
$msg->encoding_type()/$msg->encoding_type($value)Type:
Enum(Google::Cloud::Language::V1beta2::EncodingType)The encoding type used by the API to calculate offsets.
Google::Cloud::Language::V1beta2::LanguageService::AnalyzeSyntaxResponse
The syntax analysis response message.
Inherits from Protobuf::Message.
Accessors
$msg->sentences()/$msg->sentences($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Sentence)Sentences in the input document.
$msg->tokens()/$msg->tokens($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Token)Tokens, along with their syntactic information, in the input document.
$msg->language()/$msg->language($value)Type:
StringThe 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.
Google::Cloud::Language::V1beta2::LanguageService::ClassifyTextRequest
The document classification request message.
Inherits from Protobuf::Message.
Accessors
$msg->document()/$msg->document($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Document)Required. Input document.
$msg->classification_model_options()/$msg->classification_model_options($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::ClassificationModelOptions)Model options to use for classification. Defaults to v1 options if not specified.
Google::Cloud::Language::V1beta2::LanguageService::ClassifyTextResponse
The document classification response message.
Inherits from Protobuf::Message.
Accessors
$msg->categories()/$msg->categories($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::ClassificationCategory)Categories representing the input document.
Google::Cloud::Language::V1beta2::LanguageService::ModerateTextRequest
The document moderation request message.
Inherits from Protobuf::Message.
Accessors
$msg->document()/$msg->document($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Document)Required. Input document.
Google::Cloud::Language::V1beta2::LanguageService::ModerateTextResponse
The document moderation response message.
Inherits from Protobuf::Message.
Accessors
$msg->moderation_categories()/$msg->moderation_categories($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::ClassificationCategory)Harmful and sensitive categories representing the input document.
Google::Cloud::Language::V1beta2::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
$msg->document()/$msg->document($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Document)Required. Input document.
$msg->features()/$msg->features($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::AnnotateTextRequest::Features)Required. The enabled features.
$msg->encoding_type()/$msg->encoding_type($value)Type:
Enum(Google::Cloud::Language::V1beta2::EncodingType)The encoding type used by the API to calculate offsets.
Google::Cloud::Language::V1beta2::LanguageService::AnnotateTextResponse
The text annotations response message.
Inherits from Protobuf::Message.
Accessors
$msg->sentences()/$msg->sentences($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Sentence)Sentences in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_syntax].
$msg->tokens()/$msg->tokens($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Token)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].
$msg->entities()/$msg->entities($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::Entity)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].
$msg->document_sentiment()/$msg->document_sentiment($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::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].
$msg->language()/$msg->language($value)Type:
StringThe 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.
$msg->categories()/$msg->categories($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::ClassificationCategory)Categories identified in the input document.
$msg->moderation_categories()/$msg->moderation_categories($value)Type:
Message(Google::Cloud::Language::V1beta2::LanguageService::ClassificationCategory)Harmful and sensitive categories identified in the input document.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Language::V1beta2::LanguageService::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.