1.0 - 8.00 - TextTagger Example 3: TaggingRules, Dictionary File - 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 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