Skip to content

Commit b18463f

Browse files
committed
Added samples
1 parent 11ae38f commit b18463f

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

articles/ai-services/language-service/summarization/how-to/document-summarization.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ The biggest difference is a new `query` field in the request body (under `tasks`
216216
> [!TIP]
217217
> Query based summarization has some differentiation in the utilization of length control based on the type of query based summarization you're using:
218218
> - Query based extractive summarization supports length control by specifying sentenceCount.
219-
> - Query based abstractive summarization doesn't support length control using either sentenceCount or summarylength.
219+
> - Query based abstractive summarization doesn't support length control.
220220
221221
Below is an example request:
222222

@@ -269,9 +269,81 @@ For the `summaryLength` parameter, three values are accepted:
269269
* medium: Generates a summary of mostly 4-6 sentences, with around 170 tokens.
270270
* long: Generates a summary of mostly over 7 sentences, with around 210 tokens.
271271

272+
Below is an example request:
273+
274+
```bash
275+
curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-text/jobs?api-version=2023-04-01 \
276+
-H "Content-Type: application/json" \
277+
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
278+
-d \
279+
'
280+
{
281+
"displayName": "Text Abstractive Summarization Task Example",
282+
"analysisInput": {
283+
"documents": [
284+
{
285+
"id": "1",
286+
"language": "en",
287+
"text": "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there’s magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code enables us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pretrained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks."
288+
}
289+
]
290+
},
291+
"tasks": [
292+
{
293+
"kind": "AbstractiveSummarization",
294+
"taskName": "Text Abstractive Summarization Task 1",
295+
"parameters": {
296+
"sentenceLength": "short"
297+
}
298+
}
299+
]
300+
}
301+
'
302+
```
303+
272304
#### Using the sentenceCount parameter in extractive summarization
273305
For the `sentenceCount` parameter, you can input a value 1-20 to indicate the desired number of output sentences.
274306

307+
Below is an example request:
308+
309+
```bash
310+
curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-text/jobs?api-version=2023-11-15-preview \
311+
-H "Content-Type: application/json" \
312+
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
313+
-d \
314+
'
315+
{
316+
"displayName": "Text Extractive Summarization Task Example",
317+
"analysisInput": {
318+
"documents": [
319+
{
320+
"id": "1",
321+
"language": "en",
322+
"text": "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there’s magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code enables us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pretrained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks."
323+
}
324+
]
325+
},
326+
"tasks": [
327+
{
328+
"kind": "AbstractiveSummarization",
329+
"taskName": "Query-based Abstractive Summarization",
330+
"parameters": {
331+
"query": "XYZ-code",
332+
"summaryLength": "short"
333+
}
334+
}, {
335+
"kind": "ExtractiveSummarization",
336+
"taskName": "Query_based Extractive Summarization",
337+
"parameters": {
338+
"query": "XYZ-code"
339+
"sentenceCount": "5"
340+
}
341+
}
342+
]
343+
}
344+
'
345+
```
346+
275347
## Service and data limits
276348

277349
[!INCLUDE [service limits article](../../includes/service-limits-link.md)]

0 commit comments

Comments
 (0)