---
schema_version: "1"
id: cde6d35e5d87f19c338b561c48f466aa36f2def57e345c9fe8f4ed086053eca4
title: Configuring Sentiment Analysis Operations
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/amazon-bedrock-connector/1.0/configuring-sentiment-analysis-operations.md
canonical_url: https://docs.mulesoft.com/amazon-bedrock-connector/1.0/configuring-sentiment-analysis-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e44f956ec3e9fe2e9142463ac7bb610558be76a51f279f9d0e08409386ec4829
description: MuleSoft Documentation Site
release: "1.0"
latest: false
---
---
product: Amazon Bedrock Connector
version: 1.0
---

# Configuring Sentiment Analysis Operations

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Configure the **SENTIMENT Analyze** operation.

## Configure the SENTIMENT Analyze Operation

The **SENTIMENT Analyze** operation is a simple prompt request to the configured LLM. It sends a
plain text prompt as input and receives a sentiment response for the input text. The possible
sentiment values are `NEUTRAL`, `POSITIVE`, or `NEGATIVE`.

Apply the **SENTIMENT Analyze** operation in various scenarios, such as for:

- **Customer Feedback Analysis**

  Determining whether customer feedback is positive, negative, or neutral.

- **Social Media Monitoring**

  Analyzing the sentiment of social media posts or comments to gauge public opinion.

- **Market Research**

  Assessing the sentiment of survey responses or market research data.

To configure the **SENTIMENT Analyze** operation:

1.  Select the operation on the Anypoint Code Builder or Studio canvas.

2.  In the **General** properties tab for the operation, enter these values:

    - **Text to analyze**

      The text to be analyzed for sentiment.

    - **Model name**

      The name of the LLM. You can select any model from the supported LLM Providers.

    - **Region**

      The AWS region.

    - **Temperature**

      A value between 0 and 1 that regulates the creativity of LLMs' responses. Use lower
      temperature if you want more deterministic responses, and use higher temperature if you want
      more creative or different responses for the same prompt from LLMs on Amazon Bedrock. The
      current default value is 0.7. For sentiment analysis, use a lower temperature for more
      consistent results.

    - **Top p**

      The percentage of most-likely candidates that the model considers for the next token. It
      typically ranges between 0.9 and 0.95. Refer to the model provider documentation to confirm
      whether this parameter is supported and to verify the appropriate acceptable range.

    - **Top k**

      The number of most-likely candidates that the model considers for the next token. It typically
      ranges between 0.4 and 0.6. Refer to the model provider documentation to confirm whether this
      parameter is supported and to verify the appropriate acceptable range.

    - **Max token count**

      The maximum number of tokens to consume during output generation. For consistent and
      predictable responses, it is recommended to explicitly configure maxTokens based on the
      model’s supported limits and expected output size.

This is the XML for this operation:

```xml
<ms-bedrock:
  sentiment-analyze
  doc:name="Sentiment analyze"
  doc:id="9a67cf44-5709-409d-9fc1-2ec34d6bf858"
  config-ref="AWS"
  TextToAnalyze="#[payload.data]"
/>
```

### Output Configuration

This operation responds with a JSON payload. This is an example response:

```json
{
  "inputTextTokenCount": 117,
  "results": [
    {
      "tokenCount": 7,
      "outputText": "\nThe sentiment is positive.",
      "completionReason": "FINISH"
    }
  ]
}
```

- `inputTextTokenCount`

  Number of tokens used to process the input.

- `results`

  - `tokenCount`: Number of tokens used to generate the output.

  - `outputText`: The response from the LLM on the prompt sent.

  - `completionReason`: The reason the response finished being generated. Possible values:

    - `FINISHED` – The response was fully generated.

    - `LENGTH` – The response was truncated because of the response length you set.

    - `STOP_CRITERIA_MET` – The response was truncated because the stop criteria was reached.

    - `RAG_QUERY_WHEN_RAG_DISABLED` – The feature is disabled and cannot complete the query.

    - `CONTENT_FILTERED` – The contents were filtered or removed by the content filter applied.

## See Also

- [Amazon Bedrock Connector Overview](https://docs.mulesoft.com/amazon-bedrock-connector/1.0/)

- [Amazon Bedrock Connector Reference](https://docs.mulesoft.com/amazon-bedrock-connector/1.0/amazon-bedrock-connector-reference)

- [Salesforce Help](https://help.salesforce.com)
