SentimentEvaluator Example 4: Dictionary Table Instead of Model File - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

This example uses a dictionary table, sentiment_word, instead of a model file. See sentiment_word in SentimentExtractor Example 5: Dictionary Table Instead of Model File.

SQL Call

SELECT * FROM SentimentEvaluator (
  ON SentimentExtractor (
    ON sentiment_extract_input PARTITION BY ANY
    ON sentiment_word AS dict DIMENSION
    USING
    TextColumn ('review')
    Accumulate ('category')
  ) PARTITION BY 1
  USING
  ObservationColumn ('category')
  SentimentColumn ('out_polarity')
) AS dt;

Output

evaluation_result
positive record (total relevant, relevant, total retrieved): 5 5 6
recall and precision: 1.00 0.83
negative record (total relevant, relevant, total retrieved): 5 3 3
recall and precision: 0.60 1.00
positive and negative record (total relevant, relevant, total retrieved): 10 8 9
recall and precision: 0.80 0.89