Teradata Package for R Function Reference | 17.00 - NamedEntityFinderTrainer - Teradata Package for R - Look here for syntax, methods and examples for the functions included in the Teradata Package for R.

Teradata® Package for R Function Reference

Product
Teradata Package for R
Release Number
17.00
Published
July 2021
Language
English (United States)
Last Update
2023-08-08
dita:id
B700-4007
NMT
no
Product Category
Teradata Vantage
TrainNamedEntityFinder

Description

The TrainNamedEntityFinder function takes training data and outputs a Max Entropy data model. The function is based on OpenNLP, and follows its annotation. For more information on OpenNLP, see OpenNLP Documentation.

Usage

  td_namedentity_finder_trainer_mle (
      data = NULL,
      text.column = NULL,
      entity.type = NULL,
      model.file = NULL,
      iter.num = 100,
      cutoff = 5,
      data.sequence.column = NULL
  )

Arguments

data

Required Argument.
Specifies the input tbl_teradata containing the text column to train.

text.column

Required Argument.
Specifies the name of the input tbl_teradata column that contains the text to analyze.
Types: character

entity.type

Required Argument.
Specifies the entity type to be trained (for example, LOCATION). The input training documents must contain the same tag.
Types: character

model.file

Required Argument.
Specifies the name of the data model file to be generated.
Note: If a file with the same name exists, then it will be overwritten.
Types: character

iter.num

Optional Argument.
Specifies the iterator number for training (an openNLP training parameter).
Default Value: 100
Types: integer

cutoff

Optional Argument.
Specifies the cutoff number for training (an openNLP training parameter).
Default Value: 5
Types: integer

data.sequence.column

Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "data". The argument is used to ensure deterministic results for functions which produce results that vary from run to run.
Types: character OR vector of Strings (character)

Value

Function returns an object of class "td_namedentity_finder_trainer_mle" which is a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator using name: output.

Examples

  
    # Get the current context/connection
    con <- td_get_context()$connection
    
    # Load example data.
    loadExampleData("namedentityfindertrainer_example", "nermem_sports_train")
    
    # Create object(s) of class "tbl_teradata".
    nermem_sports_train <- tbl(con, "nermem_sports_train")
    
    # Example: Train a namedentity finder model on entity type: "LOCATION".
    # The trained model is stored in a binary file: "location.sports".
    td_neft_out <- td_namedentity_finder_trainer_mle(data = nermem_sports_train,
                                                     text.column = "content",
                                                     entity.type = "LOCATION",
                                                     model.file = "location.sports"
                                                    )