TD_SentimentExtractor Examples | SentimentExtractor - Examples: How to Use TD_SentimentExtractor - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

TD_SentimentExtractor Input Table: sentiment_extract_input

 id product      category review  
                               
 -- -------      -------- ------
  1 camera       POS      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  . i would recommend this camera to anybody  .definitely worth the price  .plus , when you buy some accessories , it becomes even more powerful
  
  2 office suite POS      it is the best office suite i have used to date  . it is launched before office 2010 and it is ages ahead of it already  . 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 . i needed the compatibility  .it is a very intuitive suite and the drag    drop functionality is terrific . 
                                                 
  3 camera       POS      this is a nice camera , delivering good quality video images decent photos  . light small , using easily obtainable , high quality minidv    i love it  .
minor irritations include touchscreen based menu only digital photos can only be trensferred via usb , requiring ilink and usb if you use ilink .
   
  4 gps          POS      it is a fine gps . outstanding performance ,  works great . you can even get incredible coordinate accuracy from streets and trips to compare . 
                                                                    
  5 gps          POS      nice graphs and map route info  .i would not run outside again without this unique gadget  . great job. big display , good backlight , really watertight , training assistant .i use in trail running and  it worked well through out the race 
                  
  6 gps          NEG      most of the complaints i have seen in here are from a lack of rtfm. i have never seen so many mistakes do to what i think has to be none update of data to the system . i wish i could make all the rating stars be empty . 
  
  7 gps          NEG      this machine is all screwed up  . on my way home from a friends house it told me there is no possible route  . i found their website support difficult to navigate . i am is so disapointed and just returned it and now looking for another one 
   
  8 camera       NEG      i hate my camera , and im stuck with it  . this camera sucks so bad , even the dealers on ebay have difficulty selling it. horrible indoors , does not capture fast action, screwy software , no suprise , and screwy audio/video codec that does not work with hardly any app 
  
  9 television   NEG      $3k is way too much money to drop onto a piece of crap .poor customer support . after about 1 and a half years and hardly using the tv , a big yellow pixilated stain appeared. product is very inferior and subject to several lawsuits  . i expressed my dissatifaction with the situation as this is a known issue 
 
 10 camera       NEG      i returned my camera to the vendor as i will not tolerate a sub standard product that is a known issue especially from vendor who will not admt that this needs to be removed from the shelf due to failing parts updated  . due to the constant need for repair , i would never recommend this product  . 

TD_SentimentExtractor InputTable: sentiment_word

 sentiment_word polarity_strength 
 -------------- ----------------- 
 big                            0
 constant                       0
 crap                          -2
 difficulty                    -1
 disappointed                  -1
 excellent                      2
 fun                            1
 incredible                     2
 love                           1
 mistake                       -1
 nice                           1
 not tolerate                  -1
 outstanding                    2
 screwed                        2
 small                          0
 stuck                         -1
 terrific                       2
 terrrible                     -2
 update                         0

TD_SentimentExtractor InputTable: sentiment_word_add

 sentiment_word  polarity_strength 
 --------------- ----------------- 
 love                            2
 need for repair                -2
 repair                         -1

Example: TD_SentimentExtractor SQL Call with Default Dictionary

SELECT * FROM TD_SentimentExtractor (
ON sentiment_extract_input AS InputTable PARTITION BY ANY
USING
TextColumn ('review')
Accumulate ('id', 'product')
AnalysisType ('DOCUMENT')
) AS dt ORDER BY id;

TD_SentimentExtractor Output with Default Dictionary

 id product      polarity    sentiment_score sentiment_words
 -- -------      --------    --------------- ---------------
  1 camera       POS         2               In total, positive score:7 negative score:0.   excelled 1 (1), excellent 1 (2), powerful 1 (1), worth 1 (1), recommend 1 (1), capability 1 (1).          
  2 office suite POS         2               In total, positive score:5 negative score:-1.  drag -1 (1), intuitive 1 (1), best 1 (1), comfortable 1 (1), terrific 1 (2).                   
  3 camera       POS         2               In total, positive score:5 negative score:-1.  decent 1 (1), good 1 (1), irritations -1 (1), nice 1 (1), love 1 (1), obtainable 1 (1).                                                 
  4 gps          POS         2               In total, positive score:5 negative score:0.   incredible 1 (1), outstanding 1 (1), fine 1 (1), great 1 (1), works 1 (1).                                                           
  5 gps          POS         2               In total, positive score:5 negative score:0.   good 1 (1), worked 1 (1), nice 1 (1), great 1 (1), well 1 (1).                                                                        
  6 gps          NEG         2               In total, positive score:0 negative score:-3.  lack -1 (1), complaints -1 (1), mistakes -1 (1).                                                                                        
  7 gps          NEG         2               In total, positive score:1 negative score:-3.  disapointed -1 (1), doomed -1 (1), difficult -1 (1), support 1 (1).                                                                   
  8 camera       NEG         2               In total, positive score:0 negative score:-10. stuck -1 (1), sucks -1 (1), screwy -1 (2), not fast -1 (1), bad -1 (1), difficulty -1 (1), horrible -1 (1), not work -1 (1), hate -1 (1).
  9 television   NEG         2               In total, positive score:1 negative score:-5.  crap -1 (1), issue -1 (1), stain -1 (1), inferior -1 (1), poor -1 (1), support 1 (1).                                                    
 10 camera       NEG         2               In total, positive score:0 negative score:-3.  failing -1 (1), issue -1 (1), never recommend -1 (1).

Example: TD_SentimentExtractor SQL Call with Custom Dictionary

SELECT * FROM TD_SentimentExtractor (
ON sentiment_extract_input AS InputTable PARTITION BY ANY
ON sentiment_word AS CustomDictionaryTable DIMENSION
USING
TextColumn ('review')
Accumulate ('id', 'product')
AnalysisType ('SENTENCE')
) AS dt ORDER BY id;

TD_SentimentExtractor Output with Custom Dictionary

 id product      content    polarity sentiment_score    sentiment_words
--- -------      -------    -------- ---------------    ---------------
  1 camera       i would recommend this camera to anybody  .definitely worth the price  .plus , when you buy some accessories , it becomes even more powerful
                            NEU      0
                                                                  
  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                  In total, positive score:4 negative score:0. excellent 2 (2). 
       
  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                  In total, positive score:2 negative score:0. terrific 2 (1). 
        
  2 office suite i needed the compatibility  .it is a very intuitive suite and the drag    drop functionality is terrific . 
                            POS      2                  In total, positive score:2 negative score:0. terrific 2 (1). 
        
  2 office suite it is launched before office 2010 and it is ages ahead of it already  .
                            NEU      0         
                                                             
  2 office suite it is the best office suite i have used to date  . 
                            NEU      0     
                 
  3 camera       minor irritations include touchscreen based menu only digital photos can only be trensferred via usb , requiring ilink and usb if you use ilink .
                            NEU      0
          
  3 camera       light small , using easily obtainable , high quality minidv    i love it  .
                            POS      2                  In total, positive score:1 negative score:0. small 0 (1), love 1 (1).

  3 camera       this is a nice camera , delivering good quality video images decent photos .
                            POS      2                  In total, positive score:1 negative score:0. nice 1 (1). 
            
  4 gps          it is a fine gps . 
                            NEU      0   
         
  4 gps          outstanding performance ,  works great .   
                            POS      2                  In total, positive score:2 negative score:0. outstanding 2 (1).
      
  4 gps          you can even get incredible coordinate accuracy from streets and trips to compare .  
                            POS      2                  In total, positive score:2 negative score:0. incredible 2 (1).
       
  5 gps          big display , good backlight , really watertight , training assistant .i use in trail running and  it worked well through out the race    
                            NEU      0                  In total, positive score:0 negative score:0. big 0 (1).
        
  5 gps          great job.  
                            NEU      0  
               
  5 gps          nice graphs and map route info  .i would not run outside again without this unique gadget  .      
                            POS      2                  In total, positive score:1 negative score:0. nice 1 (1). 
            
  6 gps          i wish i could make all the rating stars be empty .
                            NEU      0       
          
  6 gps          i have never seen so many mistakes do to what i think has to be none update of data to the system .     
                            NEU      0                  In total, positive score:0 negative score:0. update 0 (1).           
  6 gps          most of the complaints i have seen in here are from a lack of rtfm.
                            NEU      0       
                     
  7 gps          i found their website support difficult to navigate .
                            NEU      0                                                                      
  7 gps          i am is so disapointed and just returned it and now looking for another one
                            NEU      0       
                    
  7 gps          on my way home from a friends house it told me there is no possible route  .
                            NEU      0   
     
  7 gps          this machine is all screwed up  . 
                            POS      2                  In total, positive score:2 negative score:0. screwed 2 (1). 
         
  8 camera       this camera sucks so bad , even the dealers on ebay have difficulty selling it.          
                            NEG      2                  In total, positive score:0 negative score:-1. difficulty -1 (1).
     
  8 camera       i hate my camera , and im stuck with it  .
                            NEG      2                  In total, positive score:0 negative score:-1. stuck -1 (1). 
         
  8 camera       horrible indoors , does not capture fast action, screwy software , no suprise , and screwy audio/video codec that does not work with hardly any app 
                            NEU      0 
                               
  9 television   product is very inferior and subject to several lawsuits  . 
                            NEU      0     
                        
  9 television   i expressed my dissatifaction with the situation as this is a known issue
                            NEU      0      
            
  9 television   after about 1 and a half years and hardly using the tv , a big yellow pixilated stain appeared.  
                            NEU      0                  In total, positive score:0 negative score:0. big 0 (1). 
             
  9 television   $3k is way too much money to drop onto a piece of crap .poor customer support .   
                            NEG      2                  In total, positive score:0 negative score:-2. crap -2 (1).
           
 10 camera       due to the constant need for repair , i would never recommend this product .
                            NEU      0                  In total, positive score:0 negative score:0. constant 0 (1).  
       
 10 camera       i returned my camera to the vendor as i will not tolerate a sub standard product that is a known issue especially from vendor who will not admt that this needs to be removed from the shelf due to failing parts updated  .   
                            NEG      2                  In total, positive score:0 negative score:-1. not tolerate -1 (1).   

Example: TD_SentimentExtractor SQL Call with Default Dictionary and Additional Dictionary

SELECT * FROM TD_SentimentExtractor (
ON sentiment_extract_input AS InputTable PARTITION BY ANY
ON sentiment_word_add AS AdditionalDictionaryTable DIMENSION
USING
TextColumn ('review')
Accumulate ('id', 'product')
AnalysisType ('DOCUMENT')
) AS dt order by id;

TD_SentimentExtractor Output with Default Dictionary and Additional Dictionary

 id product      polarity sentiment_score    sentiment_words
 -- ------------ -------- ---------------    ---------------
  1 camera       POS          2              In total, positive score:7 negative score:0. excelled 1 (1), excellent 1 (2), powerful 1 (1), worth 1 (1), recommend 1 (1), capability 1 (1).
                      
  2 office suite POS          2              In total, positive score:5 negative score:-1. drag -1 (1), intuitive 1 (1), best 1 (1), comfortable 1 (1), terrific 1 (2).  
                       
  3 camera       POS          2              In total, positive score:6 negative score:-1. decent 1 (1), good 1 (1), irritations -1 (1), nice 1 (1), love 2 (1), obtainable 1 (1). 
                     
  4 gps          POS          2              In total, positive score:5 negative score:0. incredible 1 (1), outstanding 1 (1), fine 1 (1), great 1 (1), works 1 (1). 
                   
  5 gps          POS          2              In total, positive score:5 negative score:0. good 1 (1), worked 1 (1), nice 1 (1), great 1 (1), well 1 (1).   
                           
  6 gps          NEG          2              In total, positive score:0 negative score:-3. lack -1 (1), complaints -1 (1), mistakes -1 (1).   
               
  7 gps          NEG          2              In total, positive score:1 negative score:-3. disapointed -1 (1), screwed -1 (1), difficult -1 (1), support 1 (1).
                                 
  8 camera       NEG          2              In total, positive score:0 negative score:-10. stuck -1 (1), sucks -1 (1), screwy -1 (2), not fast -1 (1), bad -1 (1), difficulty -1 (1), horrible -1 (1), not work -1 (1), hate -1 (1).

  9 television   NEG          2              In total, positive score:1 negative score:-5. crap -1 (1), issue -1 (1), stain -1 (1), inferior -1 (1), poor -1 (1), support 1 (1).
               
 10 camera       NEG          2              In total, positive score:0 negative score:-5. failing -1 (1), need for repair -2 (1), issue -1 (1), never recommend -1 (1).