# Google Cloud Dialogflow V2 Client - Class SentimentAnalysisResult (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class SentimentAnalysisResult.

The result of sentiment analysis. Sentiment analysis inspects user input
and identifies the prevailing subjective opinion, especially to determine a
user's attitude as positive, negative, or neutral.

For DetectIntent, it needs to be configured in
[DetectIntentRequest.query_params](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.DetectIntentRequest#_Google_Cloud_Dialogflow_V2_DetectIntentRequest__getQueryParams__).
For StreamingDetectIntent, it needs to be configured in
[StreamingDetectIntentRequest.query_params](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.StreamingDetectIntentRequest#_Google_Cloud_Dialogflow_V2_StreamingDetectIntentRequest__getQueryParams__).
And for
[Participants.AnalyzeContent](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Client.ParticipantsClient#_Google_Cloud_Dialogflow_V2_Client_ParticipantsClient__analyzeContent__)
and
[Participants.StreamingAnalyzeContent](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Client.ParticipantsClient#_Google_Cloud_Dialogflow_V2_Client_ParticipantsClient__streamingAnalyzeContent__),
it needs to be configured in
[ConversationProfile.human_agent_assistant_config](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.ConversationProfile#_Google_Cloud_Dialogflow_V2_ConversationProfile__getHumanAgentAssistantConfig__)

Generated from protobuf message `google.cloud.dialogflow.v2.SentimentAnalysisResult`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ query_text_sentiment` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Sentiment` The sentiment analysis result for `query_text`. |

### getQueryTextSentiment

The sentiment analysis result for `query_text`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Sentiment|null` |   |

### hasQueryTextSentiment

### clearQueryTextSentiment

### setQueryTextSentiment

The sentiment analysis result for `query_text`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Sentiment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |