1.0 - 8.00 - TextTagger Example 2: Rules Table - 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)

The rules table, rule_inputs, defines the same rules as the TaggingRules argument in Example 1.

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(titles,"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