TextSummarize
TextSummarize[text]
generates a summary of text.
TextSummarize[text, spec]
summarizes the text according to the specification spec.
TextSummarize[texttopic,spec]
summarizes the part of text matching topic.
Details and Options
- TextSummarize is used to condense textual information.
- TextSummarize requires external service authentication, billing and internet connectivity.
- Long strings are first split into smaller chunks, summarized independently (AKA mapped) and then combined (AKA reduced).
- Possible values for text are:
-
"string" a plain string File["path"] individual file URL["url"] the text representation of "url" CloudObject[…] a cloud object LocalObject[…] a local object {obj1,obj2,…} list of objects - Possible values for spec are:
-
"Description" paraphrased text in condensed form (default) "Extracts" key sentences from text "Keywords" keywords from text in order of importance "KeywordSummary" keywords from text in order of appearance "OneLineSummary" extremely condensed abstract "Rewrite" short version of text with the same style "Title" possible title for text "Topics" main topics in text - Additionally, custom values for spec can be specified using:
-
prompt custom specification description {promptmap,promptreduce} separate prompts for the map and reduce parts - The prompti support the following values:
-
LLMPrompt["name"] repository prompt StringTemplate[…] templated text TemplateObject[…] template for creating text - The topic specification is a free-form string. It can be used to select specific portions of text.
- TextSummarize supports the following options:
-
InsertionFunction Automatic function or format to apply before inserting expressions CombinerFunction StringJoin function to apply to combine pieces within a prompt Authentication Automatic explicit user ID and API key LLMEvaluator $LLMEvaluator LLM configuration to use Method Automatic method details - The default InsertionFunction is TextString on a single chunk and StringRiffle[#, "\n\n"]& on a list of chunks.
- Detailed options can be given using Method<opt1val1 >. Possible values for opti are:
-
"ContextWindow" maximal length of the text chunks "ContextPadding" minimal overlap between chunks "SplitPattern" Automatic where to split long strings - The automatic "SplitPattern" tries to split text in paragraphs, newlines and words to create chunks smaller than "ContextWindow".
- TextSummarize uses machine learning. Its methods, training sets and biases included therein may change and yield varied results in different versions of the Wolfram Language.
Examples
open allclose allBasic Examples (2)
Scope (12)
Summary Specification (7)
Provide a succinct description of the text content:
Rewrite the text in a condensed form:
Invent a title for the provided text:
Summarize the text in a single sentence:
Find the main keywords to describe the text content:
Find the main keywords in the order they appear in the text:
Summarize the specified text by extracting the key sentences:
Text
Wolfram Research (2023), TextSummarize, Wolfram Language function, https://reference.wolfram.com/language/ref/TextSummarize.html.
CMS
Wolfram Language. 2023. "TextSummarize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TextSummarize.html.
APA
Wolfram Language. (2023). TextSummarize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TextSummarize.html