1.1 - 8.10 - NERExtractor Example - 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)

Input

  • Input table: ner_sports_test2, which contains text to analyze.
  • Rules: rule_table, which is preinstalled on ML Engine.
  • Model: ner_model.bin, output by NERTrainer Example.
Input table: ner_sports_test2
id content
528 email sports@espn.com to contact for all sport info
529 email cricket@espn.com to contact for all cricket info
530 email tennis@espn.com to contact for all tennis info
531 1= Igor Trandenkov (Russia) 5.86
532 3. Maksim Tarasov (Russia) 5.86
533 4. Tim Lobinger (Germany) 5.80
534 5. Igor Potapovich (Kazakstan) 5.80
535 6. Jean Galfione (France) 5.65
536 7. Pyotr Bochkary (Russia) 5.65
537 8. Dmitri Markov (Belarus) 5.65
583  GENEVA 1996-08-30
584  UEFA came down heavily on Belgian club Standard Liege on Friday for disgraceful behaviour in an Intertoto final match against Karlsruhe of Germany .
585 The Belgian club were fined 25
586 He was sent off for insulting the referee and then urged his team mates to protest .
587  Roberto Bisconti will be sidelined for six Euro ties after pushing the referee in the back as he protested about a Karlsruhe goal
588  Karlsruhe won the August 20 match 3-1 thanks to two late goals .
589 They took the tie 3-2 on aggregate and qualified for the UEFA Cup .
591 ATHLETICS - HARRISON
592  MONTE CARLO 1996-08-30
593 Olympic champion Kenny Harrison and world record holder Jonathan Edwards will both take part in a triple jump competition at the Solidarity Meeting for Sarajevo on September 9 .
594 The International Amateur Athletic Federation said on Friday that a schedule reshuffle had allowed organisers to hold a men s triple jump as well as the women s long jump on the one usable runway at the war-devastated Kosevo stadium .
595 Atlanta Games silver medal winner Edwards has called on other leading athletes to take part in the Sarajevo meeting -- a goodwill gesture towards Bosnia as it recovers from the war in the Balkans -- two days after the grand prix final in Milan .
596  Edwards was quoted as saying : What type of character do we show by going to the IAAF Grand Prix Final in Milan where there is a lot of money to make but refusing to make the trip to Sarajevo as a humanitarian gesture ?
598 SOCCER - BARATELLI TO COACH NICE .
599  NICE
600 Former international goalkeeper Dominique Baratelli is to coach struggling French first division side Nice
601  Baratelli
602  Nice have been unable to win any of their four league matches played this season and are lying a lowly 18th in the table .
Rules: rule_table
type regex
email [\w\-]([\.\w])+[\w]+@([\w\-]+\.)+[a-zA-Z]{2,4}

SQL Call

SELECT * FROM NERExtractor (
  ON ner_sports_test2 PARTITION BY ANY
  ON rule_table AS Rules DIMENSION
  USING
  TextColumn ('content')
  InputModelFiles ('ner_model.bin')
  ShowContext (2)
  Accumulate ('id')
) AS dt ORDER BY id, sn;

Output

 id  sn entity              type_ner start_ner end_ner context                                            approach 
 --- -- ------------------- -------- --------- ------- -------------------------------------------------- -------- 
 528  1 sports@espn.com     email            2       2 ... email sports@espn.com to contact               RULE    
 529  1 cricket@espn.com    email            2       2 ... email cricket@espn.com to contact              RULE    
 530  1 tennis@espn.com     email            2       2 ... email tennis@espn.com to contact               RULE    
 531  1 Igor Trandenkov     PER              2       3 ... 1= Igor Trandenkov (Russia) 5.86               CRF     
 532  1 Maksim Tarasov      PER              2       3 ... 3. Maksim Tarasov (Russia) 5.86                CRF     
 533  1 Tim Lobinger        PER              2       3 ... 4. Tim Lobinger (Germany) 5.80                 CRF     
 534  1 Igor Potapovich     PER              2       3 ... 5. Igor Potapovich (Kazakstan) 5.80            CRF     
 535  1 Jean Galfione       PER              2       3 ... 6. Jean Galfione (France) 5.65                 CRF     
 536  1 Pyotr Bochkary      PER              2       3 ... 7. Pyotr Bochkary (Russia) 5.65                CRF     
 537  1 Dmitri Markov       PER              2       3 ... 8. Dmitri Markov (Belarus) 5.65                CRF     
 583  1 GENEVA              LOC              1       1 ... ... GENEVA 1996-08-30 ...                      CRF     
 584  1 Standard Liege      PER              8       9 Belgian club Standard Liege on Friday              CRF     
 587  1 Roberto Bisconti    PER              1       2 ... ... Roberto Bisconti will be                   CRF     
 591  1 HARRISON            PER              3       3 ATHLETICS - HARRISON ... ...                       CRF     
 592  1 MONTE CARLO         PER              1       2 ... ... MONTE CARLO 1996-08-30 ...                 CRF     
 593  1 Kenny Harrison      PER              3       4 Olympic champion Kenny Harrison and world          CRF     
 593  2 Jonathan Edwards    PER              9      10 record holder Jonathan Edwards will both           CRF     
 596  1 What                ORG              7       7 saying : What type of                              CRF     
 598  1 BARATELLI TO        PER              3       4 SOCCER - BARATELLI TO COACH NICE                   CRF     
 599  1 NICE                PER              1       1 ... ... NICE ... ...                               CRF     
 600  1 Dominique Baratelli PER              4       5 international goalkeeper Dominique Baratelli is to CRF     
 600  2 Nice                PER             14      14 division side Nice ... ...                         CRF     
 601  1 Baratelli           PER              1       1 ... ... Baratelli ... ...                          CRF

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