Teradata Package for Python Function Reference - NamedEntityFinderEvaluator - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2021-11-19
lifecycle
previous
Product Category
Teradata Vantage

 
teradataml.analytics.mle.NamedEntityFinderEvaluator = class NamedEntityFinderEvaluator(builtins.object)
     Methods defined here:
__init__(self, newdata=None, text_column=None, model=None, newdata_sequence_column=None, newdata_order_column=None)
DESCRIPTION:
    The NamedEntityFinderEvaluator function includes two functions:
    • The NamedEntityFinderEvaluatorMap function operates as a row
      function.
    • The NamedEntityFinderEvaluatorReduce function operates as a
      partition function.
    Each function takes a set of evaluating data and creates the precision,
    recall, and F-measure values of a specified maximum entropy data model.
    Neither function supports regular-expression-based or dictionary-based
    models.
 
 
PARAMETERS:
    newdata:
        Required Argument.
        Specifies the input teradataml DataFrame containing a text column
        which contains input text.
 
    newdata_order_column:
        Optional Argument.
        Specifies Order By columns for newdata.
        Values to this argument can be provided as a list, if multiple
        columns are used for ordering.
        Types: str OR list of Strings (str)
 
    text_column:
        Required Argument.
        Specifies the name of the input teradataml DataFrame column that
        contains the text to analyze.
        Types: str
 
    model:
        Required Argument.
        Specifies the name of the model file to evaluate.
        Types: str
 
    newdata_sequence_column:
        Optional Argument.
        Specifies the list 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: str OR list of Strings (str)
 
RETURNS:
    Instance of NamedEntityFinderEvaluator.
    Output teradataml DataFrames can be accessed using attribute
    references, such as NamedEntityFinderEvaluatorObj.<attribute_name>.
    Output teradataml DataFrame attribute name is:
        result
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
    # Load example data.
    load_example_data("namedentityfinderevaluator", ["nermem_sports_train", "nermem_sports_test"])
 
    # Provided example tables are 'nermem_sports_train', 'nermem_sports_test'.
    # Table 'nermem_sports_train' contains column 'content' on which the analytical
    # function NamedEntityFinderTrainer is trained.
    # Table 'nermem_sports_test' contains column 'content' on which
    # NamedEntityFinderEvaluator is used to evaluate the content.
 
    # Create teradataml DataFrame objects.
    nermem_sports_train = DataFrame.from_table('nermem_sports_train')
    nermem_sports_test = DataFrame.from_table('nermem_sports_test')
 
    # Example 1 : Using NamedEntityFinderTrainer to train the NamedEntityFinder and
    #              get the precision, recall and F-score, on testing data using
    #              NamedEntityFinderEvaluator.
    trainer_out = NamedEntityFinderTrainer(data=nermem_sports_train,
                                           entity_type="LOCATION",
                                           text_column="content",
                                           model='location.sports')
 
    # Here model is saved in 'location.sports' and is used in NamedEntityFinderEvaluator
    # to evaluate the named entities on test data.
 
    result = NamedEntityFinderEvaluator(newdata=nermem_sports_test, text_column='content',
                                        model='location.sports')
 
    # Print the results.
    print(result.result)
__repr__(self)
Returns the string representation for a NamedEntityFinderEvaluator class instance.
get_build_time(self)
Function to return the build time of the algorithm in seconds.
When model object is created using retrieve_model(), then the value returned is 
as saved in the Model Catalog.
get_prediction_type(self)
Function to return the Prediction type of the algorithm.
When model object is created using retrieve_model(), then the value returned is 
as saved in the Model Catalog.
get_target_column(self)
Function to return the Target Column of the algorithm.
When model object is created using retrieve_model(), then the value returned is 
as saved in the Model Catalog.
show_query(self)
Function to return the underlying SQL query.
When model object is created using retrieve_model(), then None is returned.