Teradata R Package Function Reference | 17.00 - 17.00 - NamedEntityFinderEvaluator - Teradata R Package

Teradata® R Package Function Reference

prodname
Teradata R Package
vrm_release
17.00
created_date
September 2020
category
Programming Reference
featnum
B700-4007-090K

Description

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.

Usage

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

Arguments

newdata

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

newdata.order.column

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)

text.column

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

model

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

newdata.sequence.column

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)

Value

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.

Examples

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