# Cloud AutoML V1 API - Class Google::Cloud::AutoML::V1::TextSentimentAnnotation (v1.8.0)

1.8.0 (latest) 1.7.0 1.6.0 1.5.1 1.4.0 1.3.1 1.2.1 1.1.0 1.0.1 0.10.0 0.9.2 0.8.0 0.7.0 0.6.0 0.5.1 0.4.8 Reference documentation and code samples for the Cloud AutoML V1 API class Google::Cloud::AutoML::V1::TextSentimentAnnotation.

Contains annotation details specific to text sentiment.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #sentiment

    def sentiment() -> ::Integer

**Returns**

- (::Integer) --- Output only. The sentiment with the semantic, as given to the [AutoMl.ImportData](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-automl-v1/latest/Google-Cloud-AutoML-V1-AutoML-Client#Google__Cloud__AutoML__V1__AutoML__Client_import_data_instance_ "Google::Cloud::AutoML::V1::AutoML::Client#import_data (method)") when populating the dataset from which the model used for the prediction had been trained. The sentiment values are between 0 and Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), with higher value meaning more positive sentiment. They are completely relative, i.e. 0 means least positive sentiment and sentiment_max means the most positive from the sentiments present in the train data. Therefore e.g. if train data had only negative sentiment, then sentiment_max, would be still negative (although least negative). The sentiment shouldn't be confused with "score" or "magnitude" from the previous Natural Language Sentiment Analysis API.

### #sentiment=

    def sentiment=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Output only. The sentiment with the semantic, as given to the [AutoMl.ImportData](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-automl-v1/latest/Google-Cloud-AutoML-V1-AutoML-Client#Google__Cloud__AutoML__V1__AutoML__Client_import_data_instance_ "Google::Cloud::AutoML::V1::AutoML::Client#import_data (method)") when populating the dataset from which the model used for the prediction had been trained. The sentiment values are between 0 and Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), with higher value meaning more positive sentiment. They are completely relative, i.e. 0 means least positive sentiment and sentiment_max means the most positive from the sentiments present in the train data. Therefore e.g. if train data had only negative sentiment, then sentiment_max, would be still negative (although least negative). The sentiment shouldn't be confused with "score" or "magnitude" from the previous Natural Language Sentiment Analysis API.
**Returns**

- (::Integer) --- Output only. The sentiment with the semantic, as given to the [AutoMl.ImportData](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-automl-v1/latest/Google-Cloud-AutoML-V1-AutoML-Client#Google__Cloud__AutoML__V1__AutoML__Client_import_data_instance_ "Google::Cloud::AutoML::V1::AutoML::Client#import_data (method)") when populating the dataset from which the model used for the prediction had been trained. The sentiment values are between 0 and Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), with higher value meaning more positive sentiment. They are completely relative, i.e. 0 means least positive sentiment and sentiment_max means the most positive from the sentiments present in the train data. Therefore e.g. if train data had only negative sentiment, then sentiment_max, would be still negative (although least negative). The sentiment shouldn't be confused with "score" or "magnitude" from the previous Natural Language Sentiment Analysis API.