---
schema_version: "1"
id: 702e23a98f4b916f278a9f047a3f533ab63ce7ded613368299841898a9b81907
title: "Detect Sentiment Transformation: Determine the Sentiment of Text"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_integrate_recipe_transformation_detectsentiment.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_recipe_transformation_detectsentiment.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 59a3fd3ea82e1aea903cfd357fb03107e8905899dc363ba5e83b8819996f0a45
description: In CRM Analytics, text fields show valuable information such as product reviews and social media posts. Use the Detect Sentiment transformation in a Data Prep recipe to quickly categorize text into sentiments. Choose whether you want sentiment results as a decimal value on a 5-point scale, with 5 as the most positive, or as labels of Positive, Negative, and Neutral. For example, detect the sentiment of survey responses to evaluate how customers feel about your product support. If more than a certain percentage—say 30%—of the comments are negative, escalate the feedback to support management.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Detect Sentiment Transformation: Determine the Sentiment of Text

In CRM Analytics, text fields show valuable information such as product reviews and social media posts. Use the Detect Sentiment transformation in a Data Prep recipe to quickly categorize text into sentiments. Choose whether you want sentiment results as a decimal value on a 5-point scale, with 5 as the most positive, or as labels of Positive, Negative, and Neutral. For example, detect the sentiment of survey responses to evaluate how customers feel about your product support. If more than a certain percentage—say 30%—of the comments are negative, escalate the feedback to support management.

### Required Editions

## Detect Sentiment Transformation: Determine the Sentiment of Text

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d171307e39">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d171307e39 ">To create a recipe:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d171307e39 ">Edit CRM Analytics Dataflows OR Edit Dataset Recipes</td>

          </tr>
        </tbody>
      </table>

This transformation works on a text (dimension) column and supports English text only. It processes non-English text as English and ignores images, including emoji. If the input value is null or an empty string (''), the transformation assigns the sentiment as Neutral or with a value of 2.5, depending on the output type. Applying Detect Sentiment on text such as IDs, nouns, addresses, or alphanumeric values) can return unexpected results.

1. In a Transform node of a Data Prep recipe, select the text (dimension) column that contains the text for sentiment analysis in the Preview tab.
2. In the Transform toolbar, click the Detect Sentiment button (![Detect Sentiment button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_transformation_detectSentiment_button.png)).
    
    ![Detect Sentiment setup panel.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_transformation_detectSentiment.png)
3. Optionally, use More Options in the setup panel to change the output type or to show sentiment scores.
    
    ![Detect Sentiment setup panel showing the more options section.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_transformation_detectSentiment_moreOptions.png)
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:15.94896331738437%">
              <col style="width:84.05103668261563%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d171307e87">Options</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d171307e89">Description</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d171307e87 ">Output Type</td>
                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d171307e89 ">
                  <p>Results of the sentiment analysis in a new column in the dataset.</p>
                  <p>Text (default) shows detected sentiment as Positive, Neutral, or Negative. </p>
                  <p>Number shows detected sentiment as a decimal value on a scale of from 1
                    through 5, with 5 as the most positive.</p>
                  <p>When determining sentiment, Detect Sentiment classifies
                    the text into groups from 1 through 5.</p>
                  <p>When output is Text, the sentiment
                    values are mapped to the numbers as follows:</p>
                  <ul>
                    <li>Positive is &gt;3.50 and &lt;= 5.00</li>
                    <li>Neutral is &gt;= 2.50 and &lt; 3.5</li>
                    <li>Negative is &gt;= 1.00 and &lt; 2.50</li>
                  </ul>
                  <p>When output is Number, the sentiment is calculated as a weighted
                    sum of the number probabilities.</p>
                  <div style="text-align:left;"><img style="width:300px;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_transformation_detectSentiment_measure.png" alt="Example table of sentiment calculated as a measure."></div>
                </td>
              </tr>
              <tr class="">
                <td data-label="Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d171307e87 ">Show Sentiment Score</td>
                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d171307e89 ">
                  <p>Einstein self-assesses its confidence in the accuracy of each sentiment
                    option. Sentiment scores are decimal values that add up to 1 and that can be
                    used in formulas. For example, trigger a support case when an online review
                    is negative with a strong sentiment score.</p>
                  <p>None (default) shows the detected sentiment column only. No sentiment
                    scores are added to the dataset. </p>
                  <p>All Sentiments shows the detected sentiment column and sentiment score
                    columns in the dataset. </p>
                  <ul>
                    <li>If output type is Text, sentiment scores appear in three columns for
                      Positive, Neutral, and Negative.</li>
                    <li>If output type is Number, sentiment scores appear in five columns for 1,
                      2, 3, 4, and 5.</li>
                  </ul>
                </td>
              </tr>
            </tbody>
          </table>
4. Optionally, to change the label of the column that stores the detected sentiments, go to Column Label.![The Transform modal allows you to change the column label.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_detect_sentiment_edit.png)
5. To add the transformation to the Transform node, click **Apply**.
    
    The Preview tab shows the new sentiment column. The column shows the temporary value Sentiment TBD. To see the detected sentiment results, run the recipe.
    
    ![Preview shows "Sentiment TBD" for the new column.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipe_detect_sentiment_preview.png)
6. To collapse the view and see the graph, click (![Collapse button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_button_collapse.png)).
7. Save the recipe.

After you run the recipe, you can view the detected sentiments in the sentiment column.

- **[Detect Sentiment Model Card](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_transformation_detectsentimentmodelcard.htm&release=264.0.0&type=5)**  
    In CRM Analytics, the Detect Sentiment transformation uses the model to determine whether the sentiment of text is positive, negative, or neutral. Use this model card to better understand the model, how it’s trained, its capabilities, its intended use, and its limitations.