1.1 - 8.10 - TextTagger Example: TaggingRules, Dictionary File - 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)

This example uses this dictionary file, keywords.txt:

floods
tsunamis
Roger
Nadal
India
Pakistan
England
Australia

Input

SQL Call

SELECT * FROM TextTagger (
  ON text_inputs
  USING
  TaggingRules ('dict(content, "keywords.txt", 1,) AND
          equal(titles, "Chennai Floods") AS Natural-Disaster',
         'dict(content, "keywords.txt", 2,) AND
          equal(catalog, "sports") AS Great-Sports-Rivalry '
  )
  Accumulate ('id')
) AS dt ORDER BY id;

Output

 id tag                  
 -- -------------------- 
  1 Natural-Disaster    
  2                     
  3 Great-Sports-Rivalry
  4 Great-Sports-Rivalry
  5 Great-Sports-Rivalry

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