Summaries, chapters, and highlights
Use the /summarize
endpoint if you want to utilize pre-defined formats for general summarization tasks and, optionally, provide a prompt to customize the output. This endpoint generates the following:
- Summaries: The platform returns a brief that encapsulates the key points of a video, presenting the most important information clearly and concisely. Depending on your prompt, a summary can take various forms, such as a single paragraph, a series of paragraphs, an email, or a structured list of bullet points. For example, a summary highlighting Black Friday events might include a description of a crowded mall, key commentary by a news reporter on consumer behavior, and individual perspectives on societal values associated with consumption.
- Chapters: The platform returns a chronological list of all the chapters in a video, providing a granular breakdown of its content. For each chapter, the platform returns its starting and end times, measured in seconds from the beginning of the video, a descriptive headline that offers a brief of the events or activities within that chapter, and an accompanying summary that elaborates on the headline. For example, the first chapter of a stand-up comedy might describe the comedian’s entrance and the first joke. The accompanying summary could delve into the content, detailing the comedian’s humorous take on a specific subject, such as the cultural nuances of Tai Chi exercises.
- Highlights: The platform returns a chronologically ordered list of the most important events within a video. Unlike chapters, highlights only capture the key moments, providing a snapshot of the video’s main topics. For each highlight, the platform returns its starting and end times, measured in seconds from the beginning of the video, and a brief that captures its essence. For example, a highlight might capture a significant event like a bank heist in a video with multiple scenes.
Below are some ways in which you can guide the platform to generate content tailored to your specific needs:
For a description of each field in the request and response, see the API Reference > Generate ummaries, chapters, or highlights section.
Prerequisites
The examples in this guide assume the following:
- You’re familiar with the concepts that are described on the Platform overview page.
- You’ve already created an index and the Pegasus video understanding engine is enabled for this index.
- You’ve uploaded a video, and the platform has finished indexing it.
Generate a summary
To generate a summary based on the content of a video, invoke the summarize
method of the generate
object with the following parameters:
video_id
: A string representing the unique identifier of the video for which you want to generate a title.type
: A string representing the type of text you want to generate. This example usessummary
.
The output should look similar to the following one:
Optionally, you can use the prompt
parameter to provide context for the summarization task. The following example specifies the purpose and the desired length:
The output should look similar to the following one:
Generate chapters
To generate a list of chapters based on the content of a video, invoke the summarize
method of the generate
object with the following parameters:
video_id
: A string representing the unique identifier of the video for which you want to generate a title.type
: A string representing the type of text you want to generate. This example useschapter
.
The output should look similar to the following one:
The following example uses the prompt
parameter to indicate that the tone of voice should be casual and conversational, matching the vlogging style of the video:
Generate highlights
To generate a list of the important events or activities within a video, invoke the summarize
method of the generate
object with the following parameters:
video_id
: A string representing the unique identifier of the video for which you want to generate a title.type
: A string representing the type of text you want to generate. This example useshighlight
.
The output should be similar to the following one:
The following example uses the prompt
parameter to generate highlights for the same video, showcasing the most entertaining parts:
The output should look similar to the following one: