Learn R Programming

chatAI4R (version 0.3.6)

TextSummary: Summarize Long Text

Description

This function summarizes a long text using LLM. The development of this function started with the idea that it might be interesting to perform a copy-and-paste, sentence summarization and aims to be an evangelist for copy-and-paste LLM execution. It is recommended to run this function with GPT-4, but it is not cost effective and slow. This is still an experimental feature.

Usage

TextSummary(
  text = clipr::read_clip(),
  nch = 2000,
  verbose = TRUE,
  returnText = FALSE
)

Value

The summarized text is placed into the clipboard and the function returns the result of clipr::write_clip.

Arguments

text

A character vector containing the text to be summarized. If not provided, the function will attempt to read from the clipboard.

nch

Integer specifying the number of characters at which to split the input text for processing.

verbose

A logical flag to print the message. Default is TRUE.

returnText

A logical flag to return summarized text results. Default is FALSE.

Author

Satoshi Kume

Details

Summarize Long Text

Examples

Run this code
if (FALSE) {
TextSummary(text = c("This is a long text to be summarized.",
                     "It spans multiple sentences and goes into much detail."),
            nch = 10)
}

Run the code above in your browser using DataLab