Teradata Package for R Function Reference | 17.00 - 17.00 - NamedEntityFinderTrainer - Teradata Package for R

Teradata® Package for R Function Reference

Teradata Package for R
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)


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.


  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



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


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


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


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


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


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


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)


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.


    # 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"