Using Sentiment Extraction with Aster R - Aster R

Teradata Aster® R User GuideUpdate 3

Product
Aster R
Release Number
7.00.02.01
Published
December 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
fop1497542774450.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
fbp1477004286096
lifecycle
previous
Product Category
Software

This example uses the Aster sentiment extraction function to evaluate and classify a set of restaurant reviews.

The input data table "restaurant_reviews" table is listed here.

id review_text
1 This restaurant was great. The food was amazing. Our waiter was excellent. The appetizers in particular were very creative and well-thought-out.
2 I really enjoyed my meal, and my daughter's steak was perfectly prepared. The chocolate torte was superb.
3 The service was terrible! The food was ok, but the bread was stale and the drinks were very weak.
4 Not a must-do. Perfectly adequate but nothing special for the price.
5 I can't recommend this place. Service was slow and unfriendly. Food so-so.
6 Definitely a good choice for a special occasion. Highly recommended!
  1. Create a data frame from the input data table "restaurant_reviews".
    tadf_restaurant_reviews <- ta.data.frame('restaurant_reviews')
  2. This example uses the default values for many arguments, in particular for the object argument which specifies the source used to assign sentiment values to words. The default value for the object argument is a built-in dictionary based on the WordNet lexical database.
  3. Call the sentiment extraction function.
    result <- aa.sentiment.extract(
        newdata=tadf_restaurant_reviews,
        text.column='review_text',
        accumulate=c('id') 
    )

    The output is shown here.