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 AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
359 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,416 questions
{count} votes

Accepted answer
  1. dupammi 7,130 Reputation points Microsoft Vendor
    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.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful