No longer supported
AI21 Studio's summarize models offer access to our world-class summarization engine. They have been specifically developed for providing a faithful summary of documents, meeting and call transcripts, chat correspondences, and more.
Due to their optimization for this specific purposes, they are simpler to integrate into your systems, more efficient, and less costly than developing a summarization engine from the ground up.
Summarization Models
1. Summarize
The /summarize
API takes a piece of text or fetches text from a given URL and generates grounded summaries that remain faithful to the original document (i.e. no external information is added during the process). The summaries are formatted as bullet lists, following the original text flow.
Summarize API request
With only 2 required parameters in the payload, using this API is as simple as it gets:
source
: The input text, or URL of a web page to be summarized.
sourceType
: The type of the above - either TEXT
or URL
.
Optional:
focus
: Return only summaries focused on a topic of your choice.
To get a more customized summarization, you also have an optional parameter:
focus
: Return only summaries focused on a topic of your choice. Up to 50 characters.
{
"source": "We’ve all experienced reading long, tedious, and boring pieces of text - financial reports, legal documents, or terms and conditions (though, who actually reads those terms and conditions to be honest?). Imagine a company that employs hundreds of thousands of employees. In today's information overload age, nearly 30% of the workday is spent dealing with documents. There's no surprise here, given that some of these documents are long and convoluted on purpose (did you know that reading through all your privacy policies would take almost a quarter of a year?). Aside from inefficiency, workers may simply refrain from reading some documents (for example, Only 16% of Employees Read Their Employment Contracts Entirely Before Signing!). This is where AI-driven summarization tools can be helpful: instead of reading entire documents, which is tedious and time-consuming, users can (ideally) quickly extract relevant information from a text. With large language models, the development of those tools is easier than ever, and you can offer your users a summary that is specifically tailored to their preferences. Let's take legal documents, for example. Though they are written in English, many people find legal documents to be difficult to comprehend, as if they were actually written in a foreign language. Moreover, the interesting parts of each document may differ depending on the person who reads it, so off-the-shelf summarization tools may be too general or too specific. As an example, let's look at the involved personas:",
"sourceType": "TEXT",
"focus": "AI-driven summarization" // Optional
}
The following is a possible response for the example request above:
{
"id": "4f4acb3a-bfb5-a35c-99e5-0be572d97835",
"summary": "AI-driven summarization tools can help users extract relevant information from a text, instead of reading entire documents, which is tedious and time-consuming."
}
2. Summarize by Segment
The /summary-by-segment
API takes a piece of text or fetches text from a given URL and breaks it into logical segments, returning summarized content for each segment, rather than one overall summary. This method is particularly useful for enabling users to read the original text faster and more efficiently. They can skim where possible and pay more attention where needed.
Summarize by Segment API request
While still easy to integrate, this API gives you a deeper dive into your content with segment-focused summaries:
source
: The input text, or URL of a web page to be summarized.
sourceType
: The type of the above - either TEXT
or URL
.
Optional:
focus
: Return segment summaries focused on a topic of your choice. Up to 50 characters.
{
"source": "example long text",
"sourceType": "TEXT",
"focus": "something specific" // Optional
}
The response will return segmented summaries, each containing:
summary
: A brief summary of the segment.segmentText
: The raw text of the segment.segmentHtml
: The HTML representation of the segment, if applicable.segmentType
: Type of the segment.hasSummary
: Indicates if the segment can be summarized.highlights
: An array of key points that were extracted from the text. Each entry within this array captures theText
, itsstartIndex
, andendIndex
.
A potential response might look like:
{
"segments": [
{
"summary": "Segment-specific summary here...",
"segmentText": "Raw text of the segment here...",
"segmentHtml": "<p>HTML representation here...</p>",
"segmentType": "Type here...",
"hasSummary": true,
"highlights": [
{
"Text": "Highlighted part of the segment...",
"startIndex": 0,
"endIndex": 50
},
// ... more highlights
]
},
// ... more segments
]
}