1.0 - 8.00 - SentimentEvaluator Example 1: Model ('dictionary') - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

This example uses the dictionary model file default_sentiment_lexicon.txt.

SQL Call

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

Output

evaluation_result
positive record (total relevant, relevant, total retrieved): 5 5 5
recall and precision: 1.00 1.00
negative record (total relevant, relevant, total retrieved): 5 5 5
recall and precision: 1.00 1.00
positive and negative record (total relevant, relevant, total retrieved): 10 10 10
recall and precision: 1.00 1.00