1.0 - 8.00 - SentimentExtractor Example 2: ModelFile ('dictionary'), AnalysisType ('sentence') - 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 SentimentExtractor (
  ON sentiment_extract_input
  USING
  TextColumn ('review')
  ModelFile ('dictionary')
  AnalysisType ('sentence')
  Accumulate ('id', 'product')
) AS dt ORDER BY id;

Output

id product out_content out_polarity out_strength out_sentiment_words
1 camera we primarily bought this camera for high image quality and excellent video capability without paying the price for a dslr. it has excelled in what we expected of it, and consequently represented excellent value for me. all my friends want my camera for their vacations. POS 2 excellent 1, capability 1, excelled 1, excellent 1. In total, positive score:4 negative score:0
1 camera i would recommend this camera to anybody. definitely worth the price. plus, when you buy some accessories, it becomes even more powerful. POS 2 recommend 1, worth 1, powerful 1. In total, positive score:3 negative score:0
2 office suite it is the best office suite i have used to date. POS 2 best 1. In total, positive score:1 negative score:0
2 office suite it is launched before office 2010 and it is ages ahead of it already. NEU 0  
2 office suite the fact that i could comfortable import xls, doc, ppt and modify them, and then export them back to the doc, xls, ppt is terrific. POS 2 comfortable 1, terrific 1. In total, positive score:2 negative score:0
... ... ... ... ... ...