Share via


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

minLength: 1

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 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

OAuth2Auth

Type: oauth2
Flow: accessCode
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize
Token URL: https://login.microsoftonline.com/common/oauth2/token

Scopes

Name Description
https://cognitiveservices.azure.com/.default

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.

Value Description
EntityLinking

Entity linking task

EntityRecognition

Entity recognition task

KeyPhraseExtraction

Key phrase extraction task

LanguageDetection

Language detection task

PiiEntityRecognition

PII entity recognition task

SentimentAnalysis

Sentiment analysis task

AnalyzeTextTaskResultsKind

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

Value Description
EntityLinkingResults

Entity linking results

EntityRecognitionResults

Entity recognition results

KeyPhraseExtractionResults

Key phrase extraction results

LanguageDetectionResults

Language detection results

PiiEntityRecognitionResults

PII entity recognition results

SentimentAnalysisResults

Sentiment analysis results

DetectedLanguage

Contains the details of the detected language for the text.

Name Type Description
confidenceScore

number (double)

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).

Value Description
mixed

Mixed statement

negative

Negative statement

neutral

Neutral statement

positive

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 (int32)

Number of text elements recognized in the document.

transactionsCount

integer (int32)

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 (double)

Confidence score between 0 and 1 of the extracted entity.

length

integer (int32)

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

offset

integer (int32)

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.

Value Description
AzureCognitiveSearchIndexLimitReached

Azure Cognitive Search index limit reached error

AzureCognitiveSearchIndexNotFound

Azure Cognitive Search index not found error

AzureCognitiveSearchNotFound

Azure Cognitive Search not found error

AzureCognitiveSearchThrottling

Azure Cognitive Search throttling error

Conflict

Conflict error

Forbidden

Forbidden access error

InternalServerError

Internal server error

InvalidArgument

Invalid argument error

InvalidRequest

Invalid request error

NotFound

Not found error

OperationNotFound

Operation not found error

ProjectNotFound

Project not found error

QuotaExceeded

Quota exceeded error

ServiceUnavailable

Service unavailable error

Timeout

Timeout error

TooManyRequests

Too many requests error

Unauthorized

Unauthorized access error

Warning

Warning error

ErrorResponse

Error response.

Name Type Description
error

Error

The error object.

InnerErrorCode

Human-readable error code.

Value Description
AzureCognitiveSearchNotFound

Azure Cognitive Search not found error

AzureCognitiveSearchThrottling

Azure Cognitive Search throttling error

EmptyRequest

Empty request error

ExtractionFailure

Extraction failure error

InvalidCountryHint

Invalid country hint error

InvalidDocument

Invalid document error

InvalidDocumentBatch

Invalid document batch error

InvalidParameterValue

Invalid parameter value error

InvalidRequest

Invalid request error

InvalidRequestBodyFormat

Invalid request body format error

KnowledgeBaseNotFound

Knowledge base not found error

MissingInputDocuments

Missing input documents error

ModelVersionIncorrect

Model version incorrect error

UnsupportedLanguageCode

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 (double)

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

length

integer (int32)

Length for the entity match text.

offset

integer (int32)

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

Value Description
ABARoutingNumber

ABA Routing number

ARNationalIdentityNumber

AR National Identity Number

ATIdentityCard

AT Identity Card

ATTaxIdentificationNumber

AT Tax Identification Number

ATValueAddedTaxNumber

AT Value Added Tax Number

AUBankAccountNumber

AT Bank Account Number

AUBusinessNumber

AU Business Number

AUCompanyNumber

AU Company Number

AUDriversLicenseNumber

AU Driver's License Number

AUMedicalAccountNumber

AU Medical Account Number

AUPassportNumber

AU Passport Number

AUTaxFileNumber

AU Tax File Number

Address

Address

Age

Age

All

All PII categories.

AzureDocumentDBAuthKey

Azure Document DB Auth Key

AzureIAASDatabaseConnectionAndSQLString

Azure IAAS Database Connection And SQL String

AzureIoTConnectionString

Azure IoT Connection String

AzurePublishSettingPassword

Azure Publish Setting Password

AzureRedisCacheString

Azure Redis Cache String

AzureSAS

Azure SAS

AzureServiceBusString

Azure Service Bus String

AzureStorageAccountGeneric

Azure Storage Account Generic

AzureStorageAccountKey

Azure Storage Account Key

BENationalNumber

BE National Number

BENationalNumberV2

BE National Number V2

BEValueAddedTaxNumber

BE Value Added Tax Number

BGUniformCivilNumber

BG Uniform Civil Number

BRCPFNumber

BR CPF Number

BRLegalEntityNumber

BR Legal Entity Number

BRNationalIDRG

BR National ID RG

CABankAccountNumber

CA Bank Account Number

CADriversLicenseNumber

CA Driver's License Number

CAHealthServiceNumber

CA Health Service Number

CAPassportNumber

CA Passport Number

CAPersonalHealthIdentification

CA Personal Health Identification

CASocialInsuranceNumber

CA Social Insurance Number

CHSocialSecurityNumber

CH Social Security Number

CLIdentityCardNumber

CL Identity Card Number

CNResidentIdentityCardNumber

CN Resident Identity Card Number

CYIdentityCard

CY Identity Card

CYTaxIdentificationNumber

CY Tax Identification Number

CZPersonalIdentityNumber

CZ Personal Identity Number

CZPersonalIdentityV2

CZ Personal Identity V2

CreditCardNumber

Credit Card Number

DEDriversLicenseNumber

DE Driver's License Number

DEIdentityCardNumber

DE Identity Card Number

DEPassportNumber

DE Passport Number

DETaxIdentificationNumber

DE Tax Identification Number

DEValueAddedNumber

DE Value Added Number

DKPersonalIdentificationNumber

DK Personal Identification Number

DKPersonalIdentificationV2

DK Personal Identification V2

Date

Date

Default

Default PII categories for the language.

DrugEnforcementAgencyNumber

Drug Enforcement Agency Number

EEPersonalIdentificationCode

EE Personal Identification Code

ESDNI

ES DNI

ESSocialSecurityNumber

ES Social Security Number

ESTaxIdentificationNumber

ES Tax Identification Number

EUDebitCardNumber

EU Debit Card Number

EUDriversLicenseNumber

EU Driver's License Number

EUGPSCoordinates

EU GPS Coordinates

EUNationalIdentificationNumber

EU National Identification Number

EUPassportNumber

EU Passport Number

EUSocialSecurityNumber

EU Social Security Number

EUTaxIdentificationNumber

EU Tax Identification Number

Email

Email

FIEuropeanHealthNumber

FI European Health Number

FINationalID

FI National ID

FINationalIDV2

FI National ID V2

FIPassportNumber

FI Passport Number

FRDriversLicenseNumber

FR Driver's License Number

FRHealthInsuranceNumber

FR Health Insurance Number

FRNationalID

FR National ID

FRPassportNumber

FR Passport Number

FRSocialSecurityNumber

FR Social Security Number

FRTaxIdentificationNumber

FR Tax Identification Number

FRValueAddedTaxNumber

FR Value Added Tax Number

GRNationalIDCard

GR National ID Card

GRNationalIDV2

GR National ID V2

GRTaxIdentificationNumber

GR Tax Identification Number

HKIdentityCardNumber

HK Identity Card Number

HRIdentityCardNumber

HR Identity Card Number

HRNationalIDNumber

HR National ID Number

HRPersonalIdentificationNumber

HR Personal Identification Number

HRPersonalIdentificationOIBNumberV2

HR Personal Identification OIB Number V2

HUPersonalIdentificationNumber

HU Personal Identification Number

HUTaxIdentificationNumber

HU Tax Identification Number

HUValueAddedNumber

HU Value Added Number

IDIdentityCardNumber

ID Identity Card Number

IEPersonalPublicServiceNumber

IE Personal Public Service Number

IEPersonalPublicServiceNumberV2

IE Personal Public Service Number V2

ILBankAccountNumber

IL Bank Account Number

ILNationalID

IL National ID

INPermanentAccount

IN Permanent Account

INUniqueIdentificationNumber

IN Unique Identification Number

IPAddress

IP Address

ITDriversLicenseNumber

IT Driver's License Number

ITFiscalCode

IT Fiscal Code

ITValueAddedTaxNumber

IT Value Added Tax Number

InternationalBankingAccountNumber

International Banking Account Number

JPBankAccountNumber

JP Bank Account Number

JPDriversLicenseNumber

JP Driver's License Number

JPMyNumberCorporate

JP My Number Corporate

JPMyNumberPersonal

JP My Number Personal

JPPassportNumber

JP Passport Number

JPResidenceCardNumber

JP Residence Card Number

JPResidentRegistrationNumber

JP Resident Registration Number

JPSocialInsuranceNumber

JP Social Insurance Number

KRResidentRegistrationNumber

KR Resident Registration Number

LTPersonalCode

LT Personal Code

LUNationalIdentificationNumberNatural

LU National Identification Number Natural

LUNationalIdentificationNumberNonNatural

LU National Identification Number Non Natural

LVPersonalCode

LV Personal Code

MTIdentityCardNumber

MT Identity Card Number

MTTaxIDNumber

MT Tax ID Number

MYIdentityCardNumber

MY Identity Card Number

NLCitizensServiceNumber

NL Citizens Service Number

NLCitizensServiceNumberV2

NL Citizens Service Number V2

NLTaxIdentificationNumber

NL Tax Identification Number

NLValueAddedTaxNumber

NL Value Added Tax Number

NOIdentityNumber

NO Identity Number

NZBankAccountNumber

NZ Bank Account Number

NZDriversLicenseNumber

NZ Driver's License Number

NZInlandRevenueNumber

NZ Inland Revenue Number

NZMinistryOfHealthNumber

NZ Ministry Of Health Number

NZSocialWelfareNumber

NZ Social Welfare Number

Organization

Organization

PHUnifiedMultiPurposeIDNumber

PH Unified Multi Purpose ID Number

PLIdentityCard

PL Identity Card

PLNationalID

PL National ID

PLNationalIDV2

PL National ID V2

PLPassportNumber

PL Passport Number

PLREGONNumber

PL REGON Number

PLTaxIdentificationNumber

PL Tax Identification Number

PTCitizenCardNumber

PT Citizen Card Number

PTCitizenCardNumberV2

PT Citizen Card Number V2

PTTaxIdentificationNumber

PT Tax Identification Number

Person

Person

PhoneNumber

Phone Number

ROPersonalNumericalCode

RO Personal Numerical Code

RUPassportNumberDomestic

RU Passport Number Domestic

RUPassportNumberInternational

RU Passport Number International

SANationalID

SA National ID

SENationalID

SE National ID

SENationalIDV2

SE National ID V2

SEPassportNumber

SE Passport Number

SETaxIdentificationNumber

SE Tax Identification Number

SGNationalRegistrationIdentityCardNumber

SG National Registration Identity Card Number

SITaxIdentificationNumber

SI Tax Identification Number

SIUniqueMasterCitizenNumber

SI Unique Master Citizen Number

SKPersonalNumber

SK Personal Number

SQLServerConnectionString

SQL Server Connection String

SWIFTCode

SWIFT Code

THPopulationIdentificationCode

TH Population Identification Code

TRNationalIdentificationNumber

TR National Identification Number

TWNationalID

TW National ID

TWPassportNumber

TW Passport Number

TWResidentCertificate

TW Resident Certificate

UAPassportNumberDomestic

UA Passport Number Domestic

UAPassportNumberInternational

UA Passport Number International

UKDriversLicenseNumber

UK Driver's License Number

UKElectoralRollNumber

UK Electoral Roll Number

UKNationalHealthNumber

UK National Health Number

UKNationalInsuranceNumber

UK National Insurance Number

UKUniqueTaxpayerNumber

UK Unique Taxpayer Number

URL

URL

USBankAccountNumber

US Bank Account Number

USDriversLicenseNumber

US Driver's License Number

USIndividualTaxpayerIdentification

US Individual Taxpayer Identification

USSocialSecurityNumber

US Social Security Number

USUKPassportNumber

US UK Passport Number

ZAIdentificationNumber

ZA Identification Number

PiiDomain

Domain for PII task

Value Description
none

Indicates that no domain is specified.

phi

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

True

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 (int32)

Number of documents submitted in the request.

erroneousDocumentsCount

integer (int32)

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

transactionsCount

integer (int64)

Number of transactions for the request.

validDocumentsCount

integer (int32)

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 (int32)

The length of the target.

offset

integer (int32)

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 (int32)

The length of the target.

offset

integer (int32)

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.

Value Description
negative

Negative sentiment

neutral

Neutral sentiment

positive

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 (int32)

The length of the target.

offset

integer (int32)

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 (double)

Confidence score for negative sentiment

neutral

number (double)

Confidence score for neutral sentiment

positive

number (double)

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

Value Description
TextElements_v8

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

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

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 (double)

Confidence score for negative sentiment

positive

number (double)

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.

Value Description
assessment

Assessment relation.

target

Target relation.

TokenSentimentValue

The predicted Sentiment for the sentence.

Value Description
mixed

Mixed sentiment

negative

Negative sentiment

positive

Positive sentiment

WarningCodeValue

Defines the list of the warning codes.

Value Description
DocumentTruncated

Document truncated warning

LongWordsInDocument

Long words in document warning