1.1 - 8.10 - TextTagger Example: Rules Table - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

The Rules table, rule_inputs, defines the same rules as the TaggingRules syntax element in TextTagger Example: TaggingRules.

Input

rule_inputs
tagname definition
Cricket-Rivalry contain(content,"India",1,) and contain(content,"Pakistan",1,)
Natural-Disaster contain(content, "floods",1,) or contain(content,"tsunamis",1,)
Tennis-Greats contain(title,"Tennis",1,) and contain(content,"Roger",1,)
Tennis-Rivalry contain(content,"Roger",1,) and contain(content,"Nadal",1,)
The-Ashes contain(content,"Australia",1,) and contain(content,"England",1,)

SQL Call

SELECT * FROM TextTagger (
  ON text_inputs PARTITION BY ANY
  ON rule_inputs AS Rules DIMENSION
  USING
  Accumulate ('id')
) AS dt ORDER BY id;

Output

 id tag              
 -- ---------------- 
  1 Natural-Disaster
  2 Tennis-Greats   
  3 Tennis-Rivalry  
  4 Cricket-Rivalry 
  5 The-Ashes

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.