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

Teradata® Python Package Function Reference

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-07-17
lifecycle
previous
Product Category
Teradata Vantage

 
teradataml.analytics.mle.POSTagger = class POSTagger(builtins.object)
     Methods defined here:
__init__(self, data=None, text_column=None, language='en', accumulate=None, data_sequence_column=None, data_order_column=None)
DESCRIPTION:
    The POSTagger function generates part-of-speech (POS) tags for the
    words in the input text. POS tagging is the first step in the
    syntactic analysis of a language, and an important preprocessing step
    in many natural language processing applications.
 
 
PARAMETERS:
    data:
        Required Argument.
        Specifies the input teradataml DataFrame that contains the input texts to tag.
 
    data_order_column:
        Optional Argument.
        Specifies Order By columns for data.
        Values to this argument can be provided as 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 column that contains the text to be
        tagged.
        Types: str
 
    language:
        Optional Argument.
        Specifies the language of the input text.
        Default Value: en
        Permitted Values: en (English), zh_CN (Simplified Chinese)
        Types: str
 
    accumulate:
        Optional Argument.
        Specifies the names of the input teradataml DataFrame columns to copy
        to the output teradataml DataFrame.
        Note: If you intend to use the POSTagger output teradataml DataFrame as
              input to the function "TextChunker", then this argument must specify
              the input teradataml DataFrame columns that comprise the partition key.
        Types: str OR list of Strings (str)
 
    data_sequence_column:
        Optional Argument.
        Specifies the list 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: str OR list of Strings (str)
 
RETURNS:
    Instance of POSTagger.
    Output teradataml DataFrames can be accessed using attribute
    references, such as POSTaggerObj.<attribute_name>.
    Output teradataml DataFrame attribute name is:
        result
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
    # Load the data to run the example.
    load_example_data("postagger","paragraphs_input")
 
    # Create input teradataml dataframes
    paragraphs_input = DataFrame.from_table("paragraphs_input")
 
    # Example 1 - Applying POSTagger using default language 'en'.
    pos_tagger_out = POSTagger(data=paragraphs_input,
                       text_column='paratext',
                       accumulate='paraid')
    # Print the result DataFrame.
    print(pos_tagger_out.result)
__repr__(self)
Returns the string representation for a POSTagger class instance.