SentimentEvaluator Example | Teradata Vantage - SentimentEvaluator Example: Model ('classification:sentimentmodel1.bin') - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

This example uses the model file sentimentmodel1.bin, output by the SentimentTrainer Example.

SQL Call

SELECT * FROM SentimentEvaluator (
  ON SentimentExtractor (
    ON sentiment_extract_input
    USING
    TextColumn ('review')
    Accumulate ('category')
    InputModelFile ('classification:sentimentmodel1.bin')
  ) 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

Download a zip file of all examples and a SQL script file that creates their input tables.