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

Teradata® R Package Function Reference

Product
Teradata R Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-28
dita:id
B700-4007
lifecycle
previous
Product Category
Teradata Vantage

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