Teradata Package for R Function Reference | 17.00 - 17.00 - NamedEntityFinderEvaluator - 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 NamedEntityFinderEvaluator function invokes the NamedEntityFinderEvaluatorMap and NamedEntityFinderEvaluatorReduce functions, which operate as a row and a partition function, respectively. Each function takes a set of evaluating data and generates the precision, recall, and F-measure values of a specified maximum entropy data model. The function supports neither regular-expression-based nor dictionary-based models.


  td_namedentity_finder_evaluator_mle (
      newdata = NULL,
      text.column = NULL,
      model = NULL,
      newdata.sequence.column = NULL,
      newdata.order.column = NULL



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


Optional Argument.
Specifies Order By columns for "newdata".
Values to this argument can be provided as a vector, if multiple columns are used for ordering.
Types: character OR vector of Strings (character)


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


Required Argument.
Specifies the name of the model file to evaluate. The function TrainNamedEntityFinder (td_namedentity_finder_trainer_mle) can be used to create a model file.
Types: character


Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "newdata". 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_evaluator_mle" which is a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator using name: result.


    # Get the current context/connection
    con <- td_get_context()$connection
    # Load example data.
    loadExampleData("namedentityfinderevaluator_example", "nermem_sports_test")
    loadExampleData("namedentityfindertrainer_example", "nermem_sports_train")
    # Create object(s) of class "tbl_teradata".
    nermem_sports_train <- tbl(con, "nermem_sports_train")
    nermem_sports_test <- tbl(con, "nermem_sports_test")

    # Train a namedentity finder model on entity type: "LOCATION".
    # The trained model is stored in a binary file: "location.sports".
    td_nef_trainer_out <- td_namedentity_finder_trainer_mle(data = nermem_sports_train,
                                                            text.column = "content",
                                                            entity.type = "LOCATION",
                                                            model.file = "location.sports"

    # Example 1 - Use the model file: location.sports as the input model on the test 
    # data: nermem_sports_test.
    td_nef_evaluator_out <- td_namedentity_finder_evaluator_mle(newdata = nermem_sports_test,
                                                                text.column = "content",
                                                                model = "location.sports"