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 SemanticSearchIndex[…] semantically indexed text {obj1,obj2,…} list of objects - The topic specification is a free-form string. It can be used to select specific portions of text.
- Generating a summary from a SemanticSearchIndex[…] requires a topic specification.
- Possible values for spec are:
-
"BulletPoints" summary of text presented as concise, key points {"BulletPoints",n} summary of text in n key points "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 - 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 (14)
Input Types (5)
Summary Specification (8)
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:
Options (1)
Possible Issues (1)
Summarizing from a SemanticSearchIndex only works when a topic is specified:
Text
Wolfram Research (2024), TextSummarize, Wolfram Language function, https://reference.wolfram.com/language/ref/TextSummarize.html (updated 2024).
CMS
Wolfram Language. 2024. "TextSummarize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/TextSummarize.html.
APA
Wolfram Language. (2024). TextSummarize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TextSummarize.html