Share via

The Extractive Summarization endpoint from the Language Studio isn't working with an API call.

Joshua Bennett 20 Reputation points
2024-02-13T11:42:16.9633333+00:00

I'm trying to make use of the Extractive Summarization functionality in the Azure Language Studio by sending an API request. I have tried many variations of the API call, including the example detailed in the "Run the code" section of the "Summarization information tryout" in the Language Studio, as well as the example detailed in the following link: https://learn.microsoft.com/en-us/azure/ai-services/language-service/summarization/quickstart?tabs=document-summarization%2Cwindows&pivots=rest-api. An example API call I have tried is as follows, the key and endpoint, as well as the API version, have been set outside this JSON:

{
  "analysisInput": {
    "documents": [
      {
        "id": "text_summarisation",
        "language": "en",
        "text": "<text here>"
      }
    ]
  },
  "tasks": [
    {
      "kind": "ExtractiveSummarization",
      "parameters": {
        "sentenceCount": 3
      }
    }
  ]
}

Each time I have received the following response:

{
  "error": {
    "code": "InvalidRequest",
    "message": "Invalid task in analysisInput",
    "innererror": {
      "code": "InvalidRequestBodyFormat",
      "message": "The given value of 'kind' is not supported for API version 2023-11-15-preview.  Possible values include: EntityLinking, EntityRecognition, KeyPhraseExtraction, LanguageDetection, PiiEntityRecognition, SentimentAnalysis, CustomEntityRecognition, CustomSingleLabelClassification, CustomMultiLabelClassification"
    }
  }
}

This would seem to suggest that the summarization tools do not exist. Is there anything I am missing or doing incorrectly?

Azure Language in Foundry Tools
Azure Language in Foundry Tools

An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


Answer accepted by question author

dupammi 8,615 Reputation points Microsoft External Staff
2024-02-14T02:17:17.9966667+00:00

Hi @Joshua Bennett

Thank you for using the Microsoft Q&A forum.

Regarding your error while using the REST API url, I tried to repro your issue using POSTMAN tool. Kindly issue the POST request followed by GET request in the postman to the Language Endpoint. Once the POST request was done in the Postman, we get the "Operation Location", from where we can check the ExtractiveSummarization results. Kindly use this "Operation Location" URL in the GET request in postman. Please also provide the API key, content type etc in the GET request as well and click on "SEND" button in postman. Give the below values in POST request Header. In Body select the raw option and provide the JSON. see the below screenshots.

  1. POST request:

User's image

Copy the "Operation Location" url after clicking on the "SEND" button. see above screenshot.

  1. GET request: In the Get method, provide the Operation-Location url and Key in the Header.

User's image

For the purpose of debugging, I intentionally introduced error in my postman request, and observed that the API version was proper and also, the "ExtractiveSummarization" was listed in the possible values. See below:

User's image

"ExtractiveSummarization" was listed as one of the possible values for my API version 2023-11-15-preview. However, the error message posted in the question, doesn't list "ExtractiveSummarization" as a possible value.
To troubleshoot the issue further, I would recommend you ensure using a supported API version and the correct API endpoint for Extractive Summarization. Please also check your subscription details and ensure that you have the necessary roles, permissions and access rights. Additionally, ensure that the JSON request is correctly formatted and includes all the required parameters. To ensure you have necessary roles (Cognitive Services Contributor or owner role, Language Understanding Contributor role, Azure Cognitive Services User role) etc., please "Run" a test from the studio itself. See below.

User's image

Also, please copy&paste the values from portal to the postman API request.

User's image

Verify the API Version from studio:

User's image

If the issue persists, please raise a support request through Azure portal for further assistance.

I hope you understand! Thank you.


Please do not forget to click Accept Answer and Yes for was this answer helpful, wherever the information provided helps you. This can be beneficial to other community members.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. briancodey-9197 20 Reputation points
    2025-11-10T20:29:29.03+00:00

    The instruction provided here and from Microsoft documentation had two steps processes (a POST and a GET). The POST would provide the "operation-location", and we need to extract it to do a second GET to retrieve the summarized text. The "operation-location" GET always ran in async mode.

    Async mode is useful for large documents and for uploading files process. It is not ideal for implementing Summarization for shorter text.

    I am looking for a method to get the summarized text (either Abstractive or Extractive) synchronously. Microsoft documents for AI Language did not provide any information on calling synchronously. Copilot search returned non-working suggestions.

    Any help is greatly appreciated.

    Thanks,
    Brian

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.