Teradata Python Package Function Reference - SentenceExtractor - 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.SentenceExtractor = class SentenceExtractor(builtins.object)
     Methods defined here:
__init__(self, data=None, text_column=None, accumulate=None, data_sequence_column=None, data_order_column=None)
DESCRIPTION:
    The SentenceExtractor function extracts sentences from English input text. A
    sentence ends with a punctuation mark such as period (.), question
    mark (?), or exclamation mark (!).
 
 
PARAMETERS:
    data:
        Required Argument.
        The input teradataml DataFrame that contains the input texts.
 
    data_order_column:
        Optional Argument.
        Specifies Order By columns for data.
        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 column that contains the text from
        which to extract sentences.
        Types: str
 
    accumulate:
        Optional Argument.
        Specifies the names of the input columns to copy to the output.
        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 SentenceExtractor.
    Output teradataml DataFrames can be accessed using attribute
    references, such as SentenceExtractorObj.<attribute_name>.
    Output teradataml DataFrame attribute name is:
        result
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
    # Load the data to run the example.
    load_example_data("SentenceExtractor","paragraphs_input")
 
    # Create teradataml DataFrame objects
    paragraphs_input = DataFrame.from_table("paragraphs_input")
 
    # Example1 -
    sentenceextractor_out = SentenceExtractor(data=paragraphs_input,
                                              text_column='paratext',
                                              accumulate=['paraid','paratopic'],
                                              data_sequence_column='paraid'
                                              )
 
    # Print the results
    print(sentenceextractor_out.result)
__repr__(self)
Returns the string representation for a SentenceExtractor class instance.