Text Analysis Runtime - Analyze Text

Request text analysis over a collection of documents.

POST {Endpoint}/language/:analyze-text?api-version=2023-04-01
POST {Endpoint}/language/:analyze-text?api-version=2023-04-01&showStats={showStats}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Cognitive Services endpoint (e.g., https://.api.cognitiveservices.azure.com).

api-version
query True

string

The API version to use for this operation.

showStats
query

boolean

(Optional) if set to true, response will contain request and document level statistics.

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Request Body

The request body can be one of the following:

Name Description
AnalyzeTextEntityLinkingInput

Contains the analyze text Entity linking input.

AnalyzeTextEntityRecognitionInput

The entity recognition analyze text input task request.

AnalyzeTextKeyPhraseExtractionInput

Contains the analyze text KeyPhraseExtraction task input.

AnalyzeTextLanguageDetectionInput

Contains the language detection document analysis task input.

AnalyzeTextPiiEntitiesRecognitionInput

Contains the analyze text PIIEntityRecognition task input.

AnalyzeTextSentimentAnalysisInput

Contains the analyze text SentimentAnalysis task input.

AnalyzeTextEntityLinkingInput

Contains the analyze text Entity linking input.

Name Required Type Description
kind True string:

EntityLinking

The kind of task to perform.

analysisInput

MultiLanguageAnalysisInput

Contains the analysis input to be handled by the service.

parameters

EntityLinkingTaskParameters

Task parameters.

AnalyzeTextEntityRecognitionInput

The entity recognition analyze text input task request.

Name Required Type Description
kind True string:

EntityRecognition

The kind of task to perform.

analysisInput

MultiLanguageAnalysisInput

The input to be analyzed.

parameters

EntitiesTaskParameters

Task parameters.

AnalyzeTextKeyPhraseExtractionInput

Contains the analyze text KeyPhraseExtraction task input.

Name Required Type Description
kind True string:

KeyPhraseExtraction

The kind of task to perform.

analysisInput

MultiLanguageAnalysisInput

Contains the input documents.

parameters

KeyPhraseTaskParameters

Key phrase extraction task parameters.

AnalyzeTextLanguageDetectionInput

Contains the language detection document analysis task input.

Name Required Type Description
kind True string:

LanguageDetection

The kind of task to perform.

analysisInput

LanguageDetectionAnalysisInput

Documents to be analyzed.

parameters

LanguageDetectionTaskParameters

task parameters.

AnalyzeTextPiiEntitiesRecognitionInput

Contains the analyze text PIIEntityRecognition task input.

Name Required Type Description
kind True string:

PiiEntityRecognition

The kind of task to perform.

analysisInput

MultiLanguageAnalysisInput

Contains the input documents.

parameters

PiiTaskParameters

Pii task parameters.

AnalyzeTextSentimentAnalysisInput

Contains the analyze text SentimentAnalysis task input.

Name Required Type Description
kind True string:

SentimentAnalysis

The kind of task to perform.

analysisInput

MultiLanguageAnalysisInput

Contains the input documents.

parameters

SentimentAnalysisTaskParameters

Sentiment Analysis task parameters.

Responses

Name Type Description
200 OK AnalyzeTextTaskResult:

The request has succeeded.

Other Status Codes

ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

SuccessfulEntityLinkingRequest
SuccessfulEntityRecognitionRequest
SuccessfulKeyPhraseExtractionRequest
SuccessfulLanguageDetectionRequest
SuccessfulPiiEntityRecognitionRequest
SuccessfulSentimentAnalysisRequest

SuccessfulEntityLinkingRequest

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2023-04-01


{
  "kind": "EntityLinking",
  "parameters": {
    "modelVersion": "latest"
  },
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "Microsoft was founded by Bill Gates and Paul Allen."
      },
      {
        "id": "2",
        "language": "en",
        "text": "Pike place market is my favorite Seattle attraction."
      }
    ]
  }
}

Sample Response

{
  "kind": "EntityLinkingResults",
  "results": {
    "documents": [
      {
        "entities": [
          {
            "dataSource": "Wikipedia",
            "id": "Bill Gates",
            "language": "en",
            "matches": [
              {
                "confidenceScore": 0.52,
                "length": 10,
                "offset": 25,
                "text": "Bill Gates"
              }
            ],
            "name": "Bill Gates",
            "url": "https://en.wikipedia.org/wiki/Bill_Gates"
          },
          {
            "dataSource": "Wikipedia",
            "id": "Paul Allen",
            "language": "en",
            "matches": [
              {
                "confidenceScore": 0.54,
                "length": 10,
                "offset": 40,
                "text": "Paul Allen"
              }
            ],
            "name": "Paul Allen",
            "url": "https://en.wikipedia.org/wiki/Paul_Allen"
          },
          {
            "dataSource": "Wikipedia",
            "id": "Microsoft",
            "language": "en",
            "matches": [
              {
                "confidenceScore": 0.49,
                "length": 9,
                "offset": 0,
                "text": "Microsoft"
              }
            ],
            "name": "Microsoft",
            "url": "https://en.wikipedia.org/wiki/Microsoft"
          }
        ],
        "id": "1",
        "warnings": []
      },
      {
        "entities": [
          {
            "dataSource": "Wikipedia",
            "id": "Pike Place Market",
            "language": "en",
            "matches": [
              {
                "confidenceScore": 0.86,
                "length": 17,
                "offset": 0,
                "text": "Pike place market"
              }
            ],
            "name": "Pike Place Market",
            "url": "https://en.wikipedia.org/wiki/Pike_Place_Market"
          },
          {
            "dataSource": "Wikipedia",
            "id": "Seattle",
            "language": "en",
            "matches": [
              {
                "confidenceScore": 0.27,
                "length": 7,
                "offset": 33,
                "text": "Seattle"
              }
            ],
            "name": "Seattle",
            "url": "https://en.wikipedia.org/wiki/Seattle"
          }
        ],
        "id": "2",
        "warnings": []
      }
    ],
    "errors": [],
    "modelVersion": "2020-02-01"
  }
}

SuccessfulEntityRecognitionRequest

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2023-04-01


{
  "kind": "EntityRecognition",
  "parameters": {
    "modelVersion": "latest"
  },
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "Microsoft was founded by Bill Gates and Paul Allen."
      },
      {
        "id": "2",
        "language": "en",
        "text": "Pike place market is my favorite Seattle attraction."
      }
    ]
  }
}

Sample Response

{
  "kind": "EntityRecognitionResults",
  "results": {
    "documents": [
      {
        "entities": [
          {
            "category": "Organization",
            "confidenceScore": 0.84,
            "length": 9,
            "offset": 0,
            "text": "Microsoft"
          },
          {
            "category": "Person",
            "confidenceScore": 0.85,
            "length": 10,
            "offset": 25,
            "text": "Bill Gates"
          },
          {
            "category": "Person",
            "confidenceScore": 0.9,
            "length": 10,
            "offset": 40,
            "text": "Paul Allen"
          }
        ],
        "id": "1",
        "warnings": []
      },
      {
        "entities": [
          {
            "category": "Location",
            "confidenceScore": 0.55,
            "length": 7,
            "offset": 33,
            "subcategory": "GPE",
            "text": "Seattle"
          }
        ],
        "id": "2",
        "warnings": []
      }
    ],
    "errors": [],
    "modelVersion": "2020-04-01"
  }
}

SuccessfulKeyPhraseExtractionRequest

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2023-04-01


{
  "kind": "KeyPhraseExtraction",
  "parameters": {
    "modelVersion": "latest"
  },
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "Microsoft was founded by Bill Gates and Paul Allen."
      },
      {
        "id": "2",
        "language": "en",
        "text": "Text Analytics is one of the Azure Cognitive Services."
      },
      {
        "id": "3",
        "language": "en",
        "text": "My cat might need to see a veterinarian."
      }
    ]
  }
}

Sample Response

{
  "kind": "KeyPhraseExtractionResults",
  "results": {
    "documents": [
      {
        "id": "1",
        "keyPhrases": [
          "Bill Gates",
          "Paul Allen",
          "Microsoft"
        ],
        "warnings": []
      },
      {
        "id": "2",
        "keyPhrases": [
          "Azure Cognitive Services",
          "Text Analytics"
        ],
        "warnings": []
      },
      {
        "id": "3",
        "keyPhrases": [
          "cat",
          "veterinarian"
        ],
        "warnings": []
      }
    ],
    "errors": [],
    "modelVersion": "2021-06-01"
  }
}

SuccessfulLanguageDetectionRequest

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2023-04-01


{
  "kind": "LanguageDetection",
  "parameters": {
    "modelVersion": "latest"
  },
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "text": "Hello world"
      },
      {
        "id": "2",
        "text": "Bonjour tout le monde"
      },
      {
        "id": "3",
        "text": "Hola mundo"
      },
      {
        "id": "4",
        "text": "Tumhara naam kya hai?"
      }
    ]
  }
}

Sample Response

{
  "kind": "LanguageDetectionResults",
  "results": {
    "documents": [
      {
        "detectedLanguage": {
          "confidenceScore": 1,
          "iso6391Name": "en",
          "name": "English"
        },
        "id": "1",
        "warnings": []
      },
      {
        "detectedLanguage": {
          "confidenceScore": 1,
          "iso6391Name": "fr",
          "name": "French"
        },
        "id": "2",
        "warnings": []
      },
      {
        "detectedLanguage": {
          "confidenceScore": 1,
          "iso6391Name": "es",
          "name": "Spanish"
        },
        "id": "3",
        "warnings": []
      },
      {
        "detectedLanguage": {
          "confidenceScore": 1,
          "iso6391Name": "hi",
          "name": "Hindi"
        },
        "id": "4",
        "warnings": []
      }
    ],
    "errors": [],
    "modelVersion": "2021-01-05"
  }
}

SuccessfulPiiEntityRecognitionRequest

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2023-04-01


{
  "kind": "PiiEntityRecognition",
  "parameters": {
    "modelVersion": "latest"
  },
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "My SSN is 859-98-0987"
      },
      {
        "id": "2",
        "language": "en",
        "text": "Your ABA number - 111000025 - is the first 9 digits in the lower left hand corner of your personal check."
      },
      {
        "id": "3",
        "language": "en",
        "text": "Is 998.214.865-68 your Brazilian CPF number?"
      }
    ]
  }
}

Sample Response

{
  "kind": "PiiEntityRecognitionResults",
  "results": {
    "documents": [
      {
        "id": "1",
        "redactedText": "My SSN is ***********",
        "entities": [
          {
            "category": "USSocialSecurityNumber",
            "confidenceScore": 0.65,
            "length": 11,
            "offset": 28,
            "text": "859-98-0987"
          }
        ],
        "warnings": []
      },
      {
        "id": "2",
        "redactedText": "Your ABA number - ********* - is the first 9 digits in the lower left hand corner of your personal check.",
        "entities": [
          {
            "category": "ABARoutingNumber",
            "confidenceScore": 0.75,
            "length": 9,
            "offset": 18,
            "text": "111000025"
          }
        ],
        "warnings": []
      },
      {
        "id": "3",
        "redactedText": "Is ************** your Brazilian CPF number?",
        "entities": [
          {
            "category": "BRCPFNumber",
            "confidenceScore": 0.85,
            "length": 14,
            "offset": 3,
            "text": "998.214.865-68"
          }
        ],
        "warnings": []
      }
    ],
    "errors": [],
    "modelVersion": "2021-01-15"
  }
}

SuccessfulSentimentAnalysisRequest

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2023-04-01


{
  "kind": "SentimentAnalysis",
  "parameters": {
    "modelVersion": "latest"
  },
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "Great atmosphere. Close to plenty of restaurants, hotels, and transit! Staff are friendly and helpful."
      }
    ]
  }
}

Sample Response

{
  "kind": "SentimentAnalysisResults",
  "results": {
    "documents": [
      {
        "confidenceScores": {
          "negative": 0,
          "neutral": 0,
          "positive": 1
        },
        "id": "1",
        "sentences": [
          {
            "targets": [
              {
                "confidenceScores": {
                  "negative": 0,
                  "positive": 1
                },
                "length": 10,
                "offset": 6,
                "relations": [
                  {
                    "ref": "#/documents/0/sentences/0/assessments/0",
                    "relationType": "assessment"
                  }
                ],
                "sentiment": "positive",
                "text": "atmosphere"
              }
            ],
            "confidenceScores": {
              "negative": 0,
              "neutral": 0,
              "positive": 1
            },
            "length": 17,
            "offset": 0,
            "assessments": [
              {
                "confidenceScores": {
                  "negative": 0,
                  "positive": 1
                },
                "isNegated": false,
                "length": 5,
                "offset": 0,
                "sentiment": "positive",
                "text": "great"
              }
            ],
            "sentiment": "positive",
            "text": "Great atmosphere."
          },
          {
            "targets": [
              {
                "confidenceScores": {
                  "negative": 0.01,
                  "positive": 0.99
                },
                "length": 11,
                "offset": 37,
                "relations": [
                  {
                    "ref": "#/documents/0/sentences/1/assessments/0",
                    "relationType": "assessment"
                  }
                ],
                "sentiment": "positive",
                "text": "restaurants"
              },
              {
                "confidenceScores": {
                  "negative": 0.01,
                  "positive": 0.99
                },
                "length": 6,
                "offset": 50,
                "relations": [
                  {
                    "ref": "#/documents/0/sentences/1/assessments/0",
                    "relationType": "assessment"
                  }
                ],
                "sentiment": "positive",
                "text": "hotels"
              }
            ],
            "confidenceScores": {
              "negative": 0.01,
              "neutral": 0.86,
              "positive": 0.13
            },
            "length": 52,
            "offset": 18,
            "assessments": [
              {
                "confidenceScores": {
                  "negative": 0.01,
                  "positive": 0.99
                },
                "isNegated": false,
                "length": 15,
                "offset": 18,
                "sentiment": "positive",
                "text": "Close to plenty"
              }
            ],
            "sentiment": "neutral",
            "text": "Close to plenty of restaurants, hotels, and transit!"
          }
        ],
        "sentiment": "positive",
        "warnings": []
      }
    ],
    "errors": [],
    "modelVersion": "2021-10-01"
  }
}

Definitions

Name Description
AnalyzeTextEntityLinkingInput

Contains the analyze text Entity linking input.

AnalyzeTextEntityRecognitionInput

The entity recognition analyze text input task request.

AnalyzeTextKeyPhraseExtractionInput

Contains the analyze text KeyPhraseExtraction task input.

AnalyzeTextLanguageDetectionInput

Contains the language detection document analysis task input.

AnalyzeTextPiiEntitiesRecognitionInput

Contains the analyze text PIIEntityRecognition task input.

AnalyzeTextSentimentAnalysisInput

Contains the analyze text SentimentAnalysis task input.

AnalyzeTextTaskKind

The kind of the analyze-text tasks supported.

AnalyzeTextTaskResultsKind

The kind of the response object returned by the analyze-text task.

DetectedLanguage

Contains the details of the detected language for the text.

DocumentError

Contains details of errors encountered during a job execution.

DocumentSentimentValue

Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

DocumentWarning

Contains the warnings object with warnings encountered for the processed document.

EntitiesDocumentResult

Contains the entity recognition task result for the document.

EntitiesResult

Contains the entity recognition task result.

EntitiesTaskParameters

Supported parameters for an Entity Recognition task.

EntitiesTaskResult

Contains the entity task

Entity

Defines the detected entity object containing the entity category and entity text detected, etc.

EntityLinkingResult

Entity linking result.

EntityLinkingTaskParameters

Supported parameters for an Entity Linking task.

EntityLinkingTaskResult

Contains the analyze text Entity linking task result.

Error

The error response object returned when the service encounters some errors during processing the request.

ErrorCode

Human-readable error code.

ErrorResponse

Error response.

InnerErrorCode

Human-readable error code.

InnerErrorModel

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

KeyPhraseResult

Contains the KeyPhraseResult.

KeyPhrasesDocumentResult

Contains the Key phrase extraction results for a document.

KeyPhraseTaskParameters

Supported parameters for a Key Phrase Extraction task.

KeyPhraseTaskResult

Contains the analyze text KeyPhraseExtraction task result.

LanguageDetectionAnalysisInput

Contains the language detection document analysis input.

LanguageDetectionDocumentResult

Contains the language detection for a document.

LanguageDetectionResult

Contains the language detection result for the request.

LanguageDetectionTaskParameters

Supported parameters for a Language Detection task.

LanguageDetectionTaskResult

Contains the language detection task result for the request.

LanguageInput

Contains the language detection input.

LinkedEntitiesDocumentResult

Entity linking document result.

LinkedEntity

The LinkedEntity object containing the detected entity with the associated sources/links.

Match

The Match object containing the detected entity text with the offset and the length.

MultiLanguageAnalysisInput

Collection of input documents to be analyzed by the service.

MultiLanguageInput

Contains an input document to be analyzed by the service.

PiiCategory

(Optional) describes the PII categories to return

PiiDomain

Domain for PII task

PiiEntitiesDocumentResult

Contains the PII results.

PiiResult

Contains the PiiResult.

PiiTaskParameters

Supported parameters for a PII Entities Recognition task.

PiiTaskResult

Contains the analyze text PIIEntityRecognition LRO task.

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

SentenceAssessment

Represents a sentence assessment and the assessments or target objects related to it.

SentenceSentiment

A document's sentence sentiment.

SentenceSentimentValue

The predicted Sentiment for the sentence.

SentenceTarget

Represents a sentence target and the assessments or target objects related to it.

SentimentAnalysisTaskParameters

Supported parameters for a Sentiment Analysis task.

SentimentConfidenceScores

Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative.

SentimentDocumentResult

An object representing the pre-built Sentiment Analysis results of each document.

SentimentResponse

Sentiment analysis results for the input documents.

SentimentTaskResult

Contains the analyze text SentimentAnalysis LRO task result.

StringIndexType

String index type

TargetConfidenceScoreLabel

Represents the confidence scores across all sentiment classes: positive and negative.

TargetRelation

Represents the relation between assessments and/or targets.

TargetRelationType

The type related to the target.

TokenSentimentValue

The predicted Sentiment for the sentence.

WarningCodeValue

Defines the list of the warning codes.

AnalyzeTextEntityLinkingInput

Contains the analyze text Entity linking input.

Name Type Description
analysisInput

MultiLanguageAnalysisInput

Contains the analysis input to be handled by the service.

kind string:

EntityLinking

The kind of task to perform.

parameters

EntityLinkingTaskParameters

Task parameters.

AnalyzeTextEntityRecognitionInput

The entity recognition analyze text input task request.

Name Type Description
analysisInput

MultiLanguageAnalysisInput

The input to be analyzed.

kind string:

EntityRecognition

The kind of task to perform.

parameters

EntitiesTaskParameters

Task parameters.

AnalyzeTextKeyPhraseExtractionInput

Contains the analyze text KeyPhraseExtraction task input.

Name Type Description
analysisInput

MultiLanguageAnalysisInput

Contains the input documents.

kind string:

KeyPhraseExtraction

The kind of task to perform.

parameters

KeyPhraseTaskParameters

Key phrase extraction task parameters.

AnalyzeTextLanguageDetectionInput

Contains the language detection document analysis task input.

Name Type Description
analysisInput

LanguageDetectionAnalysisInput

Documents to be analyzed.

kind string:

LanguageDetection

The kind of task to perform.

parameters

LanguageDetectionTaskParameters

task parameters.

AnalyzeTextPiiEntitiesRecognitionInput

Contains the analyze text PIIEntityRecognition task input.

Name Type Description
analysisInput

MultiLanguageAnalysisInput

Contains the input documents.

kind string:

PiiEntityRecognition

The kind of task to perform.

parameters

PiiTaskParameters

Pii task parameters.

AnalyzeTextSentimentAnalysisInput

Contains the analyze text SentimentAnalysis task input.

Name Type Description
analysisInput

MultiLanguageAnalysisInput

Contains the input documents.

kind string:

SentimentAnalysis

The kind of task to perform.

parameters

SentimentAnalysisTaskParameters

Sentiment Analysis task parameters.

AnalyzeTextTaskKind

The kind of the analyze-text tasks supported.

Name Type Description
EntityLinking

string

Entity linking task

EntityRecognition

string

Entity recognition task

KeyPhraseExtraction

string

Key phrase extraction task

LanguageDetection

string

Language detection task

PiiEntityRecognition

string

PII entity recognition task

SentimentAnalysis

string

Sentiment analysis task

AnalyzeTextTaskResultsKind

The kind of the response object returned by the analyze-text task.

Name Type Description
EntityLinkingResults

string

Entity linking results

EntityRecognitionResults

string

Entity recognition results

KeyPhraseExtractionResults

string

Key phrase extraction results

LanguageDetectionResults

string

Language detection results

PiiEntityRecognitionResults

string

PII entity recognition results

SentimentAnalysisResults

string

Sentiment analysis results

DetectedLanguage

Contains the details of the detected language for the text.

Name Type Description
confidenceScore

number

A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.

iso6391Name

string

A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).

name

string

Long name of a detected language (e.g. English, French).

DocumentError

Contains details of errors encountered during a job execution.

Name Type Description
error

Error

Error encountered.

id

string

The ID of the input document.

DocumentSentimentValue

Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).

Name Type Description
mixed

string

Mixed statement

negative

string

Negative statement

neutral

string

Neutral statement

positive

string

Positive statement

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

Name Type Description
charactersCount

integer

Number of text elements recognized in the document.

transactionsCount

integer

Number of transactions for the document.

DocumentWarning

Contains the warnings object with warnings encountered for the processed document.

Name Type Description
code

WarningCodeValue

Warning code.

message

string

Warning message.

targetRef

string

A JSON pointer reference indicating the target object.

EntitiesDocumentResult

Contains the entity recognition task result for the document.

Name Type Description
entities

Entity[]

Recognized entities in the document.

id

string

Unique, non-empty document identifier.

statistics

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

warnings

DocumentWarning[]

Warnings encountered while processing document.

EntitiesResult

Contains the entity recognition task result.

Name Type Description
documents

EntitiesDocumentResult[]

Response by document

errors

DocumentError[]

Errors by document id.

modelVersion

string

This field indicates which model is used for scoring.

statistics

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

EntitiesTaskParameters

Supported parameters for an Entity Recognition task.

Name Type Default Value Description
loggingOptOut

boolean

False

logging opt out

modelVersion

string

latest

model version

stringIndexType

StringIndexType

TextElements_v8

(Optional) parameter to provide the string index type used to interpret string offsets. Defaults to TextElements (Graphemes).

EntitiesTaskResult

Contains the entity task

Name Type Description
kind string:

EntityRecognitionResults

The kind of task result.

results

EntitiesResult

Results for entity recognition.

Entity

Defines the detected entity object containing the entity category and entity text detected, etc.

Name Type Description
category

string

Entity type.

confidenceScore

number

Confidence score between 0 and 1 of the extracted entity.

length

integer

Length for the entity text. Use of different 'stringIndexType' values can affect the length returned.

offset

integer

Start position for the entity text. Use of different 'stringIndexType' values can affect the offset returned.

subcategory

string

(Optional) Entity sub type.

text

string

Entity text as appears in the request.

EntityLinkingResult

Entity linking result.

Name Type Description
documents

LinkedEntitiesDocumentResult[]

Response by document

errors

DocumentError[]

Errors by document id.

modelVersion

string

This field indicates which model is used for scoring.

statistics

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

EntityLinkingTaskParameters

Supported parameters for an Entity Linking task.

Name Type Default Value Description
loggingOptOut

boolean

False

logging opt out

modelVersion

string

latest

model version

stringIndexType

StringIndexType

TextElements_v8

Optional parameter to provide the string index type used to interpret string offsets. Defaults to TextElements (Graphemes).

EntityLinkingTaskResult

Contains the analyze text Entity linking task result.

Name Type Description
kind string:

EntityLinkingResults

The kind of task result.

results

EntityLinkingResult

Entity linking result.

Error

The error response object returned when the service encounters some errors during processing the request.

Name Type Description
code

ErrorCode

One of a server-defined set of error codes.

details

Error[]

An array of details about specific errors that led to this reported error.

innererror

InnerErrorModel

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

ErrorCode

Human-readable error code.

Name Type Description
AzureCognitiveSearchIndexLimitReached

string

Azure Cognitive Search index limit reached error

AzureCognitiveSearchIndexNotFound

string

Azure Cognitive Search index not found error

AzureCognitiveSearchNotFound

string

Azure Cognitive Search not found error

AzureCognitiveSearchThrottling

string

Azure Cognitive Search throttling error

Conflict

string

Conflict error

Forbidden

string

Forbidden access error

InternalServerError

string

Internal server error

InvalidArgument

string

Invalid argument error

InvalidRequest

string

Invalid request error

NotFound

string

Not found error

OperationNotFound

string

Operation not found error

ProjectNotFound

string

Project not found error

QuotaExceeded

string

Quota exceeded error

ServiceUnavailable

string

Service unavailable error

Timeout

string

Timeout error

TooManyRequests

string

Too many requests error

Unauthorized

string

Unauthorized access error

Warning

string

Warning error

ErrorResponse

Error response.

Name Type Description
error

Error

The error object.

InnerErrorCode

Human-readable error code.

Name Type Description
AzureCognitiveSearchNotFound

string

Azure Cognitive Search not found error

AzureCognitiveSearchThrottling

string

Azure Cognitive Search throttling error

EmptyRequest

string

Empty request error

ExtractionFailure

string

Extraction failure error

InvalidCountryHint

string

Invalid country hint error

InvalidDocument

string

Invalid document error

InvalidDocumentBatch

string

Invalid document batch error

InvalidParameterValue

string

Invalid parameter value error

InvalidRequest

string

Invalid request error

InvalidRequestBodyFormat

string

Invalid request body format error

KnowledgeBaseNotFound

string

Knowledge base not found error

MissingInputDocuments

string

Missing input documents error

ModelVersionIncorrect

string

Model version incorrect error

UnsupportedLanguageCode

string

Unsupported language code error

InnerErrorModel

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

Name Type Description
code

InnerErrorCode

One of a server-defined set of error codes.

details

object

Error details.

innererror

InnerErrorModel

An object containing more specific information than the current object about the error.

message

string

Error message.

target

string

Error target.

KeyPhraseResult

Contains the KeyPhraseResult.

Name Type Description
documents

KeyPhrasesDocumentResult[]

Response by document

errors

DocumentError[]

Errors by document id.

modelVersion

string

This field indicates which model is used for scoring.

statistics

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

KeyPhrasesDocumentResult

Contains the Key phrase extraction results for a document.

Name Type Description
id

string

Unique, non-empty document identifier.

keyPhrases

string[]

A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.

statistics

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

warnings

DocumentWarning[]

Warnings encountered while processing document.

KeyPhraseTaskParameters

Supported parameters for a Key Phrase Extraction task.

Name Type Default Value Description
loggingOptOut

boolean

False

logging opt out

modelVersion

string

latest

model version

KeyPhraseTaskResult

Contains the analyze text KeyPhraseExtraction task result.

Name Type Description
kind string:

KeyPhraseExtractionResults

The kind of task result.

results

KeyPhraseResult

The list of Key phrase extraction results

LanguageDetectionAnalysisInput

Contains the language detection document analysis input.

Name Type Description
documents

LanguageInput[]

List of documents to be analyzed.

LanguageDetectionDocumentResult

Contains the language detection for a document.

Name Type Description
detectedLanguage

DetectedLanguage

Detected Language.

id

string

Unique, non-empty document identifier.

statistics

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

warnings

DocumentWarning[]

Warnings encountered while processing document.

LanguageDetectionResult

Contains the language detection result for the request.

Name Type Description
documents

LanguageDetectionDocumentResult[]

Enumeration of language detection results for each input document.

errors

DocumentError[]

Errors by document id.

modelVersion

string

This field indicates which model is used for scoring.

statistics

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

LanguageDetectionTaskParameters

Supported parameters for a Language Detection task.

Name Type Default Value Description
loggingOptOut

boolean

False

logging opt out

modelVersion

string

latest

model version

LanguageDetectionTaskResult

Contains the language detection task result for the request.

Name Type Description
kind string:

LanguageDetectionResults

The kind of task result.

results

LanguageDetectionResult

Contains the language detection results.

LanguageInput

Contains the language detection input.

Name Type Description
countryHint

string

The country hint to help with language detection of the text.

id

string

A unique, non-empty document identifier.

text

string

The input text to process.

LinkedEntitiesDocumentResult

Entity linking document result.

Name Type Description
entities

LinkedEntity[]

Recognized well known entities in the document.

id

string

Unique, non-empty document identifier.

statistics

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

warnings

DocumentWarning[]

Warnings encountered while processing document.

LinkedEntity

The LinkedEntity object containing the detected entity with the associated sources/links.

Name Type Description
bingId

string

Bing Entity Search API unique identifier of the recognized entity.

dataSource

string

Data source used to extract entity linking, such as Wiki/Bing etc.

id

string

Unique identifier of the recognized entity from the data source.

language

string

Language used in the data source.

matches

Match[]

List of instances this entity appears in the text.

name

string

Entity Linking formal name.

url

string

URL for the entity's page from the data source.

Match

The Match object containing the detected entity text with the offset and the length.

Name Type Description
confidenceScore

number

If a well known item is recognized, a decimal number denoting the confidence level between 0 and 1 will be returned.

length

integer

Length for the entity match text.

offset

integer

Start position for the entity match text.

text

string

Entity text as appears in the request.

MultiLanguageAnalysisInput

Collection of input documents to be analyzed by the service.

Name Type Description
documents

MultiLanguageInput[]

The input documents to be analyzed.

MultiLanguageInput

Contains an input document to be analyzed by the service.

Name Type Description
id

string

A unique, non-empty document identifier.

language

string

(Optional) This is the 2 letter ISO 639-1 representation of a language. For example, use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default. (Following only applies to 2023-04-15-preview and above) For Auto Language Detection, use "auto". If not set, use "en" for English as default.

text

string

The input text to process.

PiiCategory

(Optional) describes the PII categories to return

Name Type Description
ABARoutingNumber

string

ABA Routing number

ARNationalIdentityNumber

string

AR National Identity Number

ATIdentityCard

string

AT Identity Card

ATTaxIdentificationNumber

string

AT Tax Identification Number

ATValueAddedTaxNumber

string

AT Value Added Tax Number

AUBankAccountNumber

string

AT Identity Card

AUBusinessNumber

string

AU Business Number

AUCompanyNumber

string

AU Company Number

AUDriversLicenseNumber

string

AU Driver's License Number

AUMedicalAccountNumber

string

AU Medical Account Number

AUPassportNumber

string

AU Passport Number

AUTaxFileNumber

string

AU Tax File Number

Address

string

Address

Age

string

Age

All

string

All PII categories.

AzureDocumentDBAuthKey

string

Azure Document DB Auth Key

AzureIAASDatabaseConnectionAndSQLString

string

Azure IAAS Database Connection And SQL String

AzureIoTConnectionString

string

Azure IoT Connection String

AzurePublishSettingPassword

string

Azure Publish Setting Password

AzureRedisCacheString

string

Azure Redis Cache String

AzureSAS

string

Azure SAS

AzureServiceBusString

string

Azure Service Bus String

AzureStorageAccountGeneric

string

Azure Storage Account Generic

AzureStorageAccountKey

string

Azure Storage Account Key

BENationalNumber

string

BE National Number

BENationalNumberV2

string

BE National Number V2

BEValueAddedTaxNumber

string

BE Value Added Tax Number

BGUniformCivilNumber

string

BG Uniform Civil Number

BRCPFNumber

string

BR CPF Number

BRLegalEntityNumber

string

BR Legal Entity Number

BRNationalIDRG

string

BR National ID RG

CABankAccountNumber

string

CA Bank Account Number

CADriversLicenseNumber

string

CA Driver's License Number

CAHealthServiceNumber

string

CA Health Service Number

CAPassportNumber

string

CA Passport Number

CAPersonalHealthIdentification

string

CA Personal Health Identification

CASocialInsuranceNumber

string

CA Social Insurance Number

CHSocialSecurityNumber

string

CH Social Security Number

CLIdentityCardNumber

string

CL Identity Card Number

CNResidentIdentityCardNumber

string

CN Resident Identity Card Number

CYIdentityCard

string

CY Identity Card

CYTaxIdentificationNumber

string

CY Tax Identification Number

CZPersonalIdentityNumber

string

CZ Personal Identity Number

CZPersonalIdentityV2

string

CZ Personal Identity V2

CreditCardNumber

string

Credit Card Number

DEDriversLicenseNumber

string

DE Driver's License Number

DEIdentityCardNumber

string

DE Identity Card Number

DEPassportNumber

string

DE Passport Number

DETaxIdentificationNumber

string

DE Tax Identification Number

DEValueAddedNumber

string

DE Value Added Number

DKPersonalIdentificationNumber

string

DK Personal Identification Number

DKPersonalIdentificationV2

string

DK Personal Identification V2

Date

string

Date

Default

string

Default PII categories for the language.

DrugEnforcementAgencyNumber

string

Drug Enforcement Agency Number

EEPersonalIdentificationCode

string

EE Personal Identification Code

ESDNI

string

ES DNI

ESSocialSecurityNumber

string

ES Social Security Number

ESTaxIdentificationNumber

string

ES Tax Identification Number

EUDebitCardNumber

string

EU Debit Card Number

EUDriversLicenseNumber

string

EU Driver's License Number

EUGPSCoordinates

string

EU GPS Coordinates

EUNationalIdentificationNumber

string

EU National Identification Number

EUPassportNumber

string

EU Passport Number

EUSocialSecurityNumber

string

EU Social Security Number

EUTaxIdentificationNumber

string

EU Tax Identification Number

Email

string

Email

FIEuropeanHealthNumber

string

FI European Health Number

FINationalID

string

FI National ID

FINationalIDV2

string

FI National ID V2

FIPassportNumber

string

FI Passport Number

FRDriversLicenseNumber

string

FR Driver's License Number

FRHealthInsuranceNumber

string

FR Health Insurance Number

FRNationalID

string

FR National ID

FRPassportNumber

string

FR Passport Number

FRSocialSecurityNumber

string

FR Social Security Number

FRTaxIdentificationNumber

string

FR Tax Identification Number

FRValueAddedTaxNumber

string

FR Value Added Tax Number

GRNationalIDCard

string

GR National ID Card

GRNationalIDV2

string

GR National ID V2

GRTaxIdentificationNumber

string

GR Tax Identification Number

HKIdentityCardNumber

string

HK Identity Card Number

HRIdentityCardNumber

string

HR Identity Card Number

HRNationalIDNumber

string

HR National ID Number

HRPersonalIdentificationNumber

string

HR Personal Identification Number

HRPersonalIdentificationOIBNumberV2

string

HR Personal Identification OIB Number V2

HUPersonalIdentificationNumber

string

HU Personal Identification Number

HUTaxIdentificationNumber

string

HU Tax Identification Number

HUValueAddedNumber

string

HU Value Added Number

IDIdentityCardNumber

string

ID Identity Card Number

IEPersonalPublicServiceNumber

string

IE Personal Public Service Number

IEPersonalPublicServiceNumberV2

string

IE Personal Public Service Number V2

ILBankAccountNumber

string

IL Bank Account Number

ILNationalID

string

IL National ID

INPermanentAccount

string

IN Permanent Account

INUniqueIdentificationNumber

string

IN Unique Identification Number

IPAddress

string

IP Address

ITDriversLicenseNumber

string

IT Driver's License Number

ITFiscalCode

string

IT Fiscal Code

ITValueAddedTaxNumber

string

IT Value Added Tax Number

InternationalBankingAccountNumber

string

International Banking Account Number

JPBankAccountNumber

string

JP Bank Account Number

JPDriversLicenseNumber

string

JP Driver's License Number

JPMyNumberCorporate

string

JP My Number Corporate

JPMyNumberPersonal

string

JP My Number Personal

JPPassportNumber

string

JP Passport Number

JPResidenceCardNumber

string

JP Residence Card Number

JPResidentRegistrationNumber

string

JP Resident Registration Number

JPSocialInsuranceNumber

string

JP Social Insurance Number

KRResidentRegistrationNumber

string

KR Resident Registration Number

LTPersonalCode

string

LT Personal Code

LUNationalIdentificationNumberNatural

string

LU National Identification Number Natural

LUNationalIdentificationNumberNonNatural

string

LU National Identification Number Non Natural

LVPersonalCode

string

LV Personal Code

MTIdentityCardNumber

string

MT Identity Card Number

MTTaxIDNumber

string

MT Tax ID Number

MYIdentityCardNumber

string

MY Identity Card Number

NLCitizensServiceNumber

string

NL Citizens Service Number

NLCitizensServiceNumberV2

string

NL Citizens Service Number V2

NLTaxIdentificationNumber

string

NL Tax Identification Number

NLValueAddedTaxNumber

string

NL Value Added Tax Number

NOIdentityNumber

string

NO Identity Number

NZBankAccountNumber

string

NZ Bank Account Number

NZDriversLicenseNumber

string

NZ Driver's License Number

NZInlandRevenueNumber

string

NZ Inland Revenue Number

NZMinistryOfHealthNumber

string

NZ Ministry Of Health Number

NZSocialWelfareNumber

string

NZ Social Welfare Number

Organization

string

Organization

PHUnifiedMultiPurposeIDNumber

string

PH Unified Multi Purpose ID Number

PLIdentityCard

string

PL Identity Card

PLNationalID

string

PL National ID

PLNationalIDV2

string

PL National ID V2

PLPassportNumber

string

PL Passport Number

PLREGONNumber

string

PL REGON Number

PLTaxIdentificationNumber

string

PL Tax Identification Number

PTCitizenCardNumber

string

PT Citizen Card Number

PTCitizenCardNumberV2

string

PT Citizen Card Number V2

PTTaxIdentificationNumber

string

PT Tax Identification Number

Person

string

Person

PhoneNumber

string

Phone Number

ROPersonalNumericalCode

string

RO Personal Numerical Code

RUPassportNumberDomestic

string

RU Passport Number Domestic

RUPassportNumberInternational

string

RU Passport Number International

SANationalID

string

SA National ID

SENationalID

string

SE National ID

SENationalIDV2

string

SE National ID V2

SEPassportNumber

string

SE Passport Number

SETaxIdentificationNumber

string

SE Tax Identification Number

SGNationalRegistrationIdentityCardNumber

string

SG National Registration Identity Card Number

SITaxIdentificationNumber

string

SI Tax Identification Number

SIUniqueMasterCitizenNumber

string

SI Unique Master Citizen Number

SKPersonalNumber

string

SK Personal Number

SQLServerConnectionString

string

SQL Server Connection String

SWIFTCode

string

SWIFT Code

THPopulationIdentificationCode

string

TH Population Identification Code

TRNationalIdentificationNumber

string

TR National Identification Number

TWNationalID

string

TW National ID

TWPassportNumber

string

TW Passport Number

TWResidentCertificate

string

TW Resident Certificate

UAPassportNumberDomestic

string

UA Passport Number Domestic

UAPassportNumberInternational

string

UA Passport Number International

UKDriversLicenseNumber

string

UK Driver's License Number

UKElectoralRollNumber

string

UK Electoral Roll Number

UKNationalHealthNumber

string

UK National Health Number

UKNationalInsuranceNumber

string

UK National Insurance Number

UKUniqueTaxpayerNumber

string

UK Unique Taxpayer Number

URL

string

URL

USBankAccountNumber

string

US Bank Account Number

USDriversLicenseNumber

string

US Driver's License Number

USIndividualTaxpayerIdentification

string

US Individual Taxpayer Identification

USSocialSecurityNumber

string

US Social Security Number

USUKPassportNumber

string

US UK Passport Number

ZAIdentificationNumber

string

ZA Identification Number

PiiDomain

Domain for PII task

Name Type Description
none

string

Indicates that no domain is specified.

phi

string

Indicates that entities in the Personal Health Information domain should be redacted.

PiiEntitiesDocumentResult

Contains the PII results.

Name Type Description
entities

Entity[]

Recognized entities in the document.

id

string

Unique, non-empty document identifier.

redactedText

string

Returns redacted text.

statistics

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

warnings

DocumentWarning[]

Warnings encountered while processing document.

PiiResult

Contains the PiiResult.

Name Type Description
documents

PiiEntitiesDocumentResult[]

Response by document

errors

DocumentError[]

Errors by document id.

modelVersion

string

This field indicates which model is used for scoring.

statistics

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

PiiTaskParameters

Supported parameters for a PII Entities Recognition task.

Name Type Default Value Description
domain

PiiDomain

none

Domain for PII task

loggingOptOut

boolean

False

logging opt out

modelVersion

string

latest

model version

piiCategories

PiiCategory[]

Enumeration of PII categories to be returned in the response.

stringIndexType

StringIndexType

TextElements_v8

StringIndexType to be used for analysis.

PiiTaskResult

Contains the analyze text PIIEntityRecognition LRO task.

Name Type Description
kind string:

PiiEntityRecognitionResults

The kind of task result.

results

PiiResult

The list of pii results

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

Name Type Description
documentsCount

integer

Number of documents submitted in the request.

erroneousDocumentsCount

integer

Number of invalid documents. This includes empty, over-size limit or non-supported languages documents.

transactionsCount

integer

Number of transactions for the request.

validDocumentsCount

integer

Number of valid documents. This excludes empty, over-size limit or non-supported languages documents.

SentenceAssessment

Represents a sentence assessment and the assessments or target objects related to it.

Name Type Description
confidenceScores

TargetConfidenceScoreLabel

Represents the confidence scores across all sentiment classes: positive and negative.

isNegated

boolean

The indicator representing if the assessment is negated.

length

integer

The length of the target.

offset

integer

The target offset from the start of the sentence.

sentiment

TokenSentimentValue

The sentiment of the sentence.

text

string

The target text detected.

SentenceSentiment

A document's sentence sentiment.

Name Type Description
assessments

SentenceAssessment[]

The array of assessments for the sentence.

confidenceScores

SentimentConfidenceScores

The sentiment confidence score between 0 and 1 for the sentence for all classes.

length

integer

The length of the target.

offset

integer

The target offset from the start of the sentence.

sentiment

SentenceSentimentValue

The predicted Sentiment for the sentence.

targets

SentenceTarget[]

The array of sentence targets for the sentence.

text

string

The sentence text.

SentenceSentimentValue

The predicted Sentiment for the sentence.

Name Type Description
negative

string

Negative sentiment

neutral

string

Neutral sentiment

positive

string

Positive sentiment

SentenceTarget

Represents a sentence target and the assessments or target objects related to it.

Name Type Description
confidenceScores

TargetConfidenceScoreLabel

Represents the confidence scores across all sentiment classes: positive and negative.

length

integer

The length of the target.

offset

integer

The target offset from the start of the sentence.

relations

TargetRelation[]

The array of either assessment or target objects which is related to the target.

sentiment

TokenSentimentValue

The sentiment of the sentence.

text

string

The target text detected.

SentimentAnalysisTaskParameters

Supported parameters for a Sentiment Analysis task.

Name Type Default Value Description
loggingOptOut

boolean

False

logging opt out

modelVersion

string

latest

model version

opinionMining

boolean

False

Whether to use opinion mining in the request or not.

stringIndexType

StringIndexType

TextElements_v8

Specifies the method used to interpret string offsets.

SentimentConfidenceScores

Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative.

Name Type Description
negative

number

Confidence score for negative sentiment

neutral

number

Confidence score for neutral sentiment

positive

number

Confidence score for positive sentiment

SentimentDocumentResult

An object representing the pre-built Sentiment Analysis results of each document.

Name Type Description
confidenceScores

SentimentConfidenceScores

The sentiment confidence score between 0 and 1 for the sentence for all classes.

id

string

Unique, non-empty document identifier.

sentences

SentenceSentiment[]

The document's sentences sentiment.

sentiment

DocumentSentimentValue

Predicted sentiment for document (Negative, Neutral, Positive, or Mixed).

statistics

DocumentStatistics

if showStats=true was specified in the request this field will contain information about the document payload.

warnings

DocumentWarning[]

Warnings encountered while processing document.

SentimentResponse

Sentiment analysis results for the input documents.

Name Type Description
documents

SentimentDocumentResult[]

The sentiment analysis results for each document in the input.

errors

DocumentError[]

Errors by document id.

modelVersion

string

This field indicates which model is used for scoring.

statistics

RequestStatistics

if showStats=true was specified in the request this field will contain information about the request payload.

SentimentTaskResult

Contains the analyze text SentimentAnalysis LRO task result.

Name Type Description
kind string:

SentimentAnalysisResults

The kind of task result.

results

SentimentResponse

The sentiment analysis results

StringIndexType

String index type

Name Type Description
TextElements_v8

string

Returned offset and length values will correspond to TextElements (Graphemes and Grapheme clusters) confirming to the Unicode 8.0.0 standard. Use this option if your application is written in .Net Framework or .Net Core and you will be using StringInfo.

UnicodeCodePoint

string

Returned offset and length values will correspond to Unicode code points. Use this option if your application is written in a language that support Unicode, for example Python.

Utf16CodeUnit

string

Returned offset and length values will correspond to UTF-16 code units. Use this option if your application is written in a language that support Unicode, for example Java, JavaScript.

TargetConfidenceScoreLabel

Represents the confidence scores across all sentiment classes: positive and negative.

Name Type Description
negative

number

Confidence score for negative sentiment

positive

number

Confidence score for positive sentiment

TargetRelation

Represents the relation between assessments and/or targets.

Name Type Description
ref

string

The JSON pointer indicating the linked object.

relationType

TargetRelationType

The type related to the target.

TargetRelationType

The type related to the target.

Name Type Description
assessment

string

target

string

TokenSentimentValue

The predicted Sentiment for the sentence.

Name Type Description
mixed

string

Mixed sentiment

negative

string

Negative sentiment

positive

string

Positive sentiment

WarningCodeValue

Defines the list of the warning codes.

Name Type Description
DocumentTruncated

string

Document truncated warning

LongWordsInDocument

string

Long words in document warning