Teradata R Package Function Reference - 16.20 - SentenceExtractor - Teradata R Package

Teradata® R Package Function Reference

prodname
Teradata R Package
vrm_release
16.20
created_date
February 2020
category
Programming Reference
featnum
B700-4007-098K

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 (!).

Usage

  td_sentence_extractor_mle (
      data = NULL,
      text.column = NULL,
      accumulate = NULL,
      data.sequence.column = NULL
  )

Arguments

data

Required Argument.
The input tbl_teradata that contains the input text.

text.column

Required Argument.
Specifies the name of the input column that contains the text from which to extract sentences.

accumulate

Optional Argument.
Specifies the names of the input columns to copy to the output table.

data.sequence.column

Optional Argument.
Specifies the vector 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.

Value

Function returns an object of class "td_sentence_extractor_mle" which is a named list containing Teradata tbl object.
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("sentenceextractor_example", "paragraphs_input")
    
    # Create remote tibble objects.
    paragraphs_input <- tbl(con, "paragraphs_input")
    
    # Example 1 -
    td_sentence_extractor_out <- td_sentence_extractor_mle(data = paragraphs_input,
                                                       text.column = "paratext",
                                                       accumulate = c("paraid", "paratopic")
                                                       )