Determining sentiment in attribute values

The Get Sentiment transformation performs two different operations when determining sentiment. In one case, the transformation detects whether string values reflect positive or negative sentiment and returns that result in a new attribute whose values are simply POSITIVE or NEGATIVE. This is the Get sentiment for entire value option.

Or alternatively, the transformation extracts a list of positive and negative terms from the value that represent positive or negative sentiment. You choose the type term that the transformation examines. Term types can be either key phrases, places, people, places, organizations, or noun groups. This is the Extract positive and negative terms option.

The Get Sentiment transformation works only on string attributes. To determine sentiment in attribute values:

  1. In the Catalog, select a project.
  2. Select Transform.
  3. Select an attribute's column that has text you want to examine for sentiment.
  4. From the transform menu, select Advanced and then Get Sentiment.
  5. In Input language, specify the language of the attribute value.
    This improves the accuracy of sentiment identification by applying a language specific identification model.
  6. Either select Get sentiment for entire value or select Extract positive and negative terms.
    (The remaining configuration options vary depending on the path you choose.)
  7. If you selected Extract positive and negative terms, specify the following:
    • Choose the type of terms to extract from the attribute value. The terms can be either key phrases, places, people, places, organizations, or noun groups.
    • Choose the sentiment you want to identify. The sentiment can be positive and negative, positive only, or negative only.
  8. In New Attribute Name, specify the name of the attribute you want to create.
    If unspecified, the default attribute name depends on the initial option you select.
    • If you select Get sentiment for entire value, Studio creates a new attribute with the name <attribute>_sentiment and the value is either POSITIVE or NEGATIVE.
    • If you select Extract positive and negative terms, Studio creates a new attribute with the name <attribute>_<term_type>_pos or <attribute>_<term_type>_neg.
  9. Either click Preview to see the previewed results of running the transformation, or click Add to Script to save the transformation step to the script.

Example

For example, if you configure the editor with Get sentiment for entire value to examine a Disposition attribute, you see that Studio creates the following new disposition_sentiment attribute highlighted in yellow:

Shows an example of the resulting new sentiment attribute.

If you are done making changes to the project data set, you can commit the changes. See Running the transformation script against a project data set.