Summarize
Creates a summary of the input text.
Usually a short text containing the most important information from a longer input text (e.g summarize an article/conversation).
Generates a new output.
Use 'Summarize' to:
Benchmarks
Coming soon...
Output text
The Summary generated by the AI.
You can access the summary value from the response JSON from output.text
field.
The summary length can be altered to fit different needs, or kept on the default automatic length.
Examples
Input | Output |
---|---|
OBI-WAN: We've got to split them up. ANAKIN: Break left, fly through the guns on that tower. OBI-WAN: Easy for you to say . . . why am I always the bait? ANAKIN: Don't worry. I'm coming around behind you. OBI-WAN: Anakin, they're all over me! ANAKIN: Dead ahead! Closing . . . lock onto him, Artoo . . . ANAKIN: We got him, Artoo! ANAKIN: I copy, Artoo. OBI-WAN: I'm going down on the deck. ANAKIN: Good idea ... I need some room to maneuver. ANAKIN: Cut right. Do you hear me?! Cut right. Don't let him get a handle on you. Come on, Artoo, lock on! Lock on! ARTOO: BEEP. BEEP. OBI-WAN: Hurry up! I don't like this! OBI-WAN: Ouch! R-4:BEEP. BEEP. BEEP. BEEP. OBI-WAN: Don't even try to fix it, Arfour. I've shut it down. ANAKIN: We're locked on ... we've got him . . . ANAKIN: Yeah! We got him . . . good going, Artoo. OBI-WAN: Next time you're the bait . . . Now let's find the Command Ship and get on with it ... R-4:BEEP. BEEP. BEEP. BEEP. ANAKIN: Lock onto them, Artoo. Master, General Grievous's ship is directly ahead. ARTOO: BEEP. BEEP. ANAKIN: The one crawling with vulture droids. | OBI-WAN and ANAKIN are chasing General Grievous's ship. |
The Hitchhiker's Guide to the Galaxy is a science fiction comedy radio series written by Douglas Adams (with some material in the first series provided by John Lloyd). It was originally broadcast in the United Kingdom by BBC Radio 4 in 1978, and afterwards the BBC World Service, National Public Radio in the US and CBC Radio in Canada. The series was the first radio comedy programme to be produced in stereo, and was innovative in its use of music and sound effects, winning a number of awards The series follows the adventures of hapless Englishman Arthur Dent and his friend Ford Prefect, an alien who writes for The Hitchhiker's Guide to the Galaxy, a pan-galactic encyclopaedia and travel guide...... | The Hitchhiker's Guide to the Galaxy is a science fiction comedy radio series written by Douglas Adams. It was originally broadcast in the United Kingdom by BBC Radio 4 in 1978, and afterwards the BBC World Service, National Public Radio in the US and CBC Radio in Canada. |
~~ ~~Optional Parameters
Name | Type | Description | Default |
---|---|---|---|
auto_length | boolean | If true then the summary will be created in an optimal length.If false , max_length and min_length will be considered if passed | true |
find_origins | boolean | if true , the response will contain labels of type origin , with indices to the words from the input used in the generated summary. | true |
max_length | number | maximum number of words in the summary | |
min_length | number | minimum number of words in the summary |
Output Labels
in case find_origins
is set to true
, origin
labels will be extracted.
Type | Description |
---|---|
origin | Identifies the origin word in the input text for each word in the output text |
Example
Request
curl -X POST \
'https://api.oneai.com/api/v0/pipeline' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'api-key: <YOUR-API-KEY-HERE>' \
-d '{
"input": "Whether to power translation to document summarization, enterprises are increasing their investments in natural language processing (NLP) technologies. According to a 2021 survey from John Snow Labs and Gradient Flow, 60% of tech leaders indicated that their NLP budgets grew by at least 10% compared to 2020, while a third said that spending climbed by more than 30%"
"steps": [
{
"skill": "summarize"
}
]
}'
const { OneAI } = require("oneai");
const oneai = new OneAI("<YOUR-API-KEY-HERE>");
const text = "Whether to power translation to document summarization, enterprises are increasing their investments in natural language processing (NLP) technologies. According to a 2021 survey from John Snow Labs and Gradient Flow, 60% of tech leaders indicated that their NLP budgets grew by at least 10% compared to 2020, while a third said that spending climbed by more than 30%";
const pipeline = new oneai.Pipeline(
oneai.skills.summarize(),
);
pipeline.run(text).then(console.log);
import oneai
oneai.api_key = "<YOUR-API-KEY-HERE>"
text = "Whether to power translation to document summarization, enterprises are increasing their investments in natural language processing (NLP) technologies. According to a 2021 survey from John Snow Labs and Gradient Flow, 60% of tech leaders indicated that their NLP budgets grew by at least 10% compared to 2020, while a third said that spending climbed by more than 30%"
pipeline = oneai.Pipeline(
steps = [
oneai.skills.Summarize(),
]
)
output = pipeline.run(text)
Response
{
"input_text": "Whether to power translation to document summarization, enterprises are increasing their investments in natural language processing (NLP) technologies. According to a 2021 survey from John Snow Labs and Gradient Flow, 60% of tech leaders indicated that their NLP budgets grew by at least 10% compared to 2020, while a third said that spending climbed by more than 30%",
"status": "success",
"output": [
{
"text_generated_by_step_name": "summarize",
"text_generated_by_step_id": 1,
"text": "60% of tech leaders indicated that their NLP budgets grew by at least 10% compared to 2020. A third said that spending climbed by more than 30%.",
"labels": [
{
"type": "origin",
"skill": "origin",
"span_text": "60",
"span": [
0,
2
],
"output_spans": [
{
"section": 0,
"start": 0,
"end": 2
}
],
"input_spans": [
{
"section": 0,
"start": 218,
"end": 220
}
]
},
// ...
]
}
],
"stats": {
"concurrency_wait_time": 0,
"total_running_jobs": 1,
"total_waiting_jobs": 0
}
}
{
text: 'Whether to power translation to document summarization, enterprises are increasing their investments in natural language processing (NLP) technologies. According to a 2021 survey from John Snow Labs and Gradient Flow, 60% of tech leaders indicated that their NLP budgets grew by at least 10% compared to 2020, while a third said that spending climbed by more than 30%',
summary: {
text: '60% of tech leaders indicated that their NLP budgets grew by at least 10% compared to 2020. A third said that spending climbed by more than 30%.',
origins: []
}
}
Updated 15 days ago