# Cloud Natural Language V2 API - Class Google::Cloud::Language::V2::AnnotateTextResponse (v1.5.0)

1.5.0 (latest) 1.4.0 1.3.0 1.2.1 1.1.0 1.0.1 0.7.0 0.6.0 0.5.1 0.4.0 0.3.2 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Natural Language V2 API class Google::Cloud::Language::V2::AnnotateTextResponse.

The text annotations response message.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #categories

    def categories() -> ::Array<::Google::Cloud::Language::V2::ClassificationCategory>

**Returns**

- (::Array\<[::Google::Cloud::Language::V2::ClassificationCategory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-ClassificationCategory)\>) --- Categories identified in the input document.

### #categories=

    def categories=(value) -> ::Array<::Google::Cloud::Language::V2::ClassificationCategory>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Language::V2::ClassificationCategory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-ClassificationCategory)\>) --- Categories identified in the input document.
**Returns**

- (::Array\<[::Google::Cloud::Language::V2::ClassificationCategory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-ClassificationCategory)\>) --- Categories identified in the input document.

### #document_sentiment

    def document_sentiment() -> ::Google::Cloud::Language::V2::Sentiment

**Returns**

- ([::Google::Cloud::Language::V2::Sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentiment)) --- The overall sentiment for the document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)").

### #document_sentiment=

    def document_sentiment=(value) -> ::Google::Cloud::Language::V2::Sentiment

**Parameter**

- **value** ([::Google::Cloud::Language::V2::Sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentiment)) --- The overall sentiment for the document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)").
**Returns**

- ([::Google::Cloud::Language::V2::Sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentiment)) --- The overall sentiment for the document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)").

### #entities

    def entities() -> ::Array<::Google::Cloud::Language::V2::Entity>

**Returns**

- (::Array\<[::Google::Cloud::Language::V2::Entity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Entity)\>) --- Entities, along with their semantic information, in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_entities](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_entities_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_entities (method)") or \[AnnotateTextRequest.Features.extract_entity_sentiment\]\[google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment\].

### #entities=

    def entities=(value) -> ::Array<::Google::Cloud::Language::V2::Entity>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Language::V2::Entity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Entity)\>) --- Entities, along with their semantic information, in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_entities](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_entities_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_entities (method)") or \[AnnotateTextRequest.Features.extract_entity_sentiment\]\[google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment\].
**Returns**

- (::Array\<[::Google::Cloud::Language::V2::Entity](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Entity)\>) --- Entities, along with their semantic information, in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_entities](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_entities_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_entities (method)") or \[AnnotateTextRequest.Features.extract_entity_sentiment\]\[google.cloud.language.v2.AnnotateTextRequest.Features.extract_entity_sentiment\].

### #language_code

    def language_code() -> ::String

**Returns**

- (::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\]\[\] field for more details.

### #language_code=

    def language_code=(value) -> ::String

**Parameter**

- **value** (::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\]\[\] field for more details.
**Returns**

- (::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\]\[\] field for more details.

### #language_supported

    def language_supported() -> ::Boolean

**Returns**

- (::Boolean) --- Whether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.

### #language_supported=

    def language_supported=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Whether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.
**Returns**

- (::Boolean) --- Whether the language is officially supported by all requested features. The API may still return a response when the language is not supported, but it is on a best effort basis.

### #moderation_categories

    def moderation_categories() -> ::Array<::Google::Cloud::Language::V2::ClassificationCategory>

**Returns**

- (::Array\<[::Google::Cloud::Language::V2::ClassificationCategory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-ClassificationCategory)\>) --- Harmful and sensitive categories identified in the input document.

### #moderation_categories=

    def moderation_categories=(value) -> ::Array<::Google::Cloud::Language::V2::ClassificationCategory>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Language::V2::ClassificationCategory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-ClassificationCategory)\>) --- Harmful and sensitive categories identified in the input document.
**Returns**

- (::Array\<[::Google::Cloud::Language::V2::ClassificationCategory](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-ClassificationCategory)\>) --- Harmful and sensitive categories identified in the input document.

### #sentences

    def sentences() -> ::Array<::Google::Cloud::Language::V2::Sentence>

**Returns**

- (::Array\<[::Google::Cloud::Language::V2::Sentence](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentence)\>) --- Sentences in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)").

### #sentences=

    def sentences=(value) -> ::Array<::Google::Cloud::Language::V2::Sentence>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Language::V2::Sentence](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentence)\>) --- Sentences in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)").
**Returns**

- (::Array\<[::Google::Cloud::Language::V2::Sentence](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Sentence)\>) --- Sentences in the input document. Populated if the user enables [AnnotateTextRequest.Features.extract_document_sentiment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-AnnotateTextRequest-Features#Google__Cloud__Language__V2__AnnotateTextRequest__Features_extract_document_sentiment_instance_ "Google::Cloud::Language::V2::AnnotateTextRequest::Features#extract_document_sentiment (method)").