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. |
show
|
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 |
---|---|
Analyze |
Contains the analyze text Entity linking input. |
Analyze |
The entity recognition analyze text input task request. |
Analyze |
Contains the analyze text KeyPhraseExtraction task input. |
Analyze |
Contains the language detection document analysis task input. |
Analyze |
Contains the analyze text PIIEntityRecognition task input. |
Analyze |
Contains the analyze text SentimentAnalysis task input. |
AnalyzeTextEntityLinkingInput
Contains the analyze text Entity linking input.
Name | Required | Type | Description |
---|---|---|---|
kind | True |
string:
Entity |
The kind of task to perform. |
analysisInput |
Contains the analysis input to be handled by the service. |
||
parameters |
Task parameters. |
AnalyzeTextEntityRecognitionInput
The entity recognition analyze text input task request.
Name | Required | Type | Description |
---|---|---|---|
kind | True |
string:
Entity |
The kind of task to perform. |
analysisInput |
The input to be analyzed. |
||
parameters |
Task parameters. |
AnalyzeTextKeyPhraseExtractionInput
Contains the analyze text KeyPhraseExtraction task input.
Name | Required | Type | Description |
---|---|---|---|
kind | True |
string:
Key |
The kind of task to perform. |
analysisInput |
Contains the input documents. |
||
parameters |
Key phrase extraction task parameters. |
AnalyzeTextLanguageDetectionInput
Contains the language detection document analysis task input.
Name | Required | Type | Description |
---|---|---|---|
kind | True |
string:
Language |
The kind of task to perform. |
analysisInput |
Documents to be analyzed. |
||
parameters |
task parameters. |
AnalyzeTextPiiEntitiesRecognitionInput
Contains the analyze text PIIEntityRecognition task input.
Name | Required | Type | Description |
---|---|---|---|
kind | True |
string:
Pii |
The kind of task to perform. |
analysisInput |
Contains the input documents. |
||
parameters |
Pii task parameters. |
AnalyzeTextSentimentAnalysisInput
Contains the analyze text SentimentAnalysis task input.
Name | Required | Type | Description |
---|---|---|---|
kind | True |
string:
Sentiment |
The kind of task to perform. |
analysisInput |
Contains the input documents. |
||
parameters |
Sentiment Analysis task parameters. |
Responses
Name | Type | Description |
---|---|---|
200 OK | AnalyzeTextTaskResult: |
The request has succeeded. |
Other Status Codes |
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
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 |
---|---|
Analyze |
Contains the analyze text Entity linking input. |
Analyze |
The entity recognition analyze text input task request. |
Analyze |
Contains the analyze text KeyPhraseExtraction task input. |
Analyze |
Contains the language detection document analysis task input. |
Analyze |
Contains the analyze text PIIEntityRecognition task input. |
Analyze |
Contains the analyze text SentimentAnalysis task input. |
Analyze |
The kind of the analyze-text tasks supported. |
Analyze |
The kind of the response object returned by the analyze-text task. |
Detected |
Contains the details of the detected language for the text. |
Document |
Contains details of errors encountered during a job execution. |
Document |
Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). |
Document |
if showStats=true was specified in the request this field will contain information about the document payload. |
Document |
Contains the warnings object with warnings encountered for the processed document. |
Entities |
Contains the entity recognition task result for the document. |
Entities |
Contains the entity recognition task result. |
Entities |
Supported parameters for an Entity Recognition task. |
Entities |
Contains the entity task |
Entity |
Defines the detected entity object containing the entity category and entity text detected, etc. |
Entity |
Entity linking result. |
Entity |
Supported parameters for an Entity Linking task. |
Entity |
Contains the analyze text Entity linking task result. |
Error |
The error response object returned when the service encounters some errors during processing the request. |
Error |
Human-readable error code. |
Error |
Error response. |
Inner |
Human-readable error code. |
Inner |
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. |
Key |
Contains the KeyPhraseResult. |
Key |
Contains the Key phrase extraction results for a document. |
Key |
Supported parameters for a Key Phrase Extraction task. |
Key |
Contains the analyze text KeyPhraseExtraction task result. |
Language |
Contains the language detection document analysis input. |
Language |
Contains the language detection for a document. |
Language |
Contains the language detection result for the request. |
Language |
Supported parameters for a Language Detection task. |
Language |
Contains the language detection task result for the request. |
Language |
Contains the language detection input. |
Linked |
Entity linking document result. |
Linked |
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. |
Multi |
Collection of input documents to be analyzed by the service. |
Multi |
Contains an input document to be analyzed by the service. |
Pii |
(Optional) describes the PII categories to return |
Pii |
Domain for PII task |
Pii |
Contains the PII results. |
Pii |
Contains the PiiResult. |
Pii |
Supported parameters for a PII Entities Recognition task. |
Pii |
Contains the analyze text PIIEntityRecognition LRO task. |
Request |
if showStats=true was specified in the request this field will contain information about the request payload. |
Sentence |
Represents a sentence assessment and the assessments or target objects related to it. |
Sentence |
A document's sentence sentiment. |
Sentence |
The predicted Sentiment for the sentence. |
Sentence |
Represents a sentence target and the assessments or target objects related to it. |
Sentiment |
Supported parameters for a Sentiment Analysis task. |
Sentiment |
Represents the confidence scores between 0 and 1 across all sentiment classes: positive, neutral, negative. |
Sentiment |
An object representing the pre-built Sentiment Analysis results of each document. |
Sentiment |
Sentiment analysis results for the input documents. |
Sentiment |
Contains the analyze text SentimentAnalysis LRO task result. |
String |
String index type |
Target |
Represents the confidence scores across all sentiment classes: positive and negative. |
Target |
Represents the relation between assessments and/or targets. |
Target |
The type related to the target. |
Token |
The predicted Sentiment for the sentence. |
Warning |
Defines the list of the warning codes. |
AnalyzeTextEntityLinkingInput
Contains the analyze text Entity linking input.
Name | Type | Description |
---|---|---|
analysisInput |
Contains the analysis input to be handled by the service. |
|
kind |
string:
Entity |
The kind of task to perform. |
parameters |
Task parameters. |
AnalyzeTextEntityRecognitionInput
The entity recognition analyze text input task request.
Name | Type | Description |
---|---|---|
analysisInput |
The input to be analyzed. |
|
kind |
string:
Entity |
The kind of task to perform. |
parameters |
Task parameters. |
AnalyzeTextKeyPhraseExtractionInput
Contains the analyze text KeyPhraseExtraction task input.
Name | Type | Description |
---|---|---|
analysisInput |
Contains the input documents. |
|
kind |
string:
Key |
The kind of task to perform. |
parameters |
Key phrase extraction task parameters. |
AnalyzeTextLanguageDetectionInput
Contains the language detection document analysis task input.
Name | Type | Description |
---|---|---|
analysisInput |
Documents to be analyzed. |
|
kind |
string:
Language |
The kind of task to perform. |
parameters |
task parameters. |
AnalyzeTextPiiEntitiesRecognitionInput
Contains the analyze text PIIEntityRecognition task input.
Name | Type | Description |
---|---|---|
analysisInput |
Contains the input documents. |
|
kind |
string:
Pii |
The kind of task to perform. |
parameters |
Pii task parameters. |
AnalyzeTextSentimentAnalysisInput
Contains the analyze text SentimentAnalysis task input.
Name | Type | Description |
---|---|---|
analysisInput |
Contains the input documents. |
|
kind |
string:
Sentiment |
The kind of task to perform. |
parameters |
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 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 |
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 |
if showStats=true was specified in the request this field will contain information about the document payload. |
|
warnings |
Warnings encountered while processing document. |
EntitiesResult
Contains the entity recognition task result.
Name | Type | Description |
---|---|---|
documents |
Response by document |
|
errors |
Errors by document id. |
|
modelVersion |
string |
This field indicates which model is used for scoring. |
statistics |
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 | 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:
Entity |
The kind of task result. |
results |
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 |
Response by document |
|
errors |
Errors by document id. |
|
modelVersion |
string |
This field indicates which model is used for scoring. |
statistics |
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 | 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:
Entity |
The kind of task result. |
results |
Entity linking result. |
Error
The error response object returned when the service encounters some errors during processing the request.
Name | Type | Description |
---|---|---|
code |
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 |
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 |
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 |
One of a server-defined set of error codes. |
|
details |
object |
Error details. |
innererror |
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 |
Response by document |
|
errors |
Errors by document id. |
|
modelVersion |
string |
This field indicates which model is used for scoring. |
statistics |
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 |
if showStats=true was specified in the request this field will contain information about the document payload. |
|
warnings |
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:
Key |
The kind of task result. |
results |
The list of Key phrase extraction results |
LanguageDetectionAnalysisInput
Contains the language detection document analysis input.
Name | Type | Description |
---|---|---|
documents |
List of documents to be analyzed. |
LanguageDetectionDocumentResult
Contains the language detection for a document.
Name | Type | Description |
---|---|---|
detectedLanguage |
Detected Language. |
|
id |
string |
Unique, non-empty document identifier. |
statistics |
if showStats=true was specified in the request this field will contain information about the document payload. |
|
warnings |
Warnings encountered while processing document. |
LanguageDetectionResult
Contains the language detection result for the request.
Name | Type | Description |
---|---|---|
documents |
Enumeration of language detection results for each input document. |
|
errors |
Errors by document id. |
|
modelVersion |
string |
This field indicates which model is used for scoring. |
statistics |
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:
Language |
The kind of task result. |
results |
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 |
Recognized well known entities in the document. |
|
id |
string |
Unique, non-empty document identifier. |
statistics |
if showStats=true was specified in the request this field will contain information about the document payload. |
|
warnings |
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 |
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 |
string |
|
|
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 |
if showStats=true was specified in the request this field will contain information about the document payload. |
|
warnings |
Warnings encountered while processing document. |
PiiResult
Contains the PiiResult.
Name | Type | Description |
---|---|---|
documents |
Response by document |
|
errors |
Errors by document id. |
|
modelVersion |
string |
This field indicates which model is used for scoring. |
statistics |
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 | none |
Domain for PII task |
|
loggingOptOut |
boolean |
False |
logging opt out |
modelVersion |
string |
latest |
model version |
piiCategories |
Enumeration of PII categories to be returned in the response. |
||
stringIndexType | TextElements_v8 |
StringIndexType to be used for analysis. |
PiiTaskResult
Contains the analyze text PIIEntityRecognition LRO task.
Name | Type | Description |
---|---|---|
kind |
string:
Pii |
The kind of task result. |
results |
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 |
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 |
The sentiment of the sentence. |
|
text |
string |
The target text detected. |
SentenceSentiment
A document's sentence sentiment.
Name | Type | Description |
---|---|---|
assessments |
The array of assessments for the sentence. |
|
confidenceScores |
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 |
The predicted Sentiment for the sentence. |
|
targets |
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 |
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 |
The array of either assessment or target objects which is related to the target. |
|
sentiment |
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 | 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 |
The sentiment confidence score between 0 and 1 for the sentence for all classes. |
|
id |
string |
Unique, non-empty document identifier. |
sentences |
The document's sentences sentiment. |
|
sentiment |
Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). |
|
statistics |
if showStats=true was specified in the request this field will contain information about the document payload. |
|
warnings |
Warnings encountered while processing document. |
SentimentResponse
Sentiment analysis results for the input documents.
Name | Type | Description |
---|---|---|
documents |
The sentiment analysis results for each document in the input. |
|
errors |
Errors by document id. |
|
modelVersion |
string |
This field indicates which model is used for scoring. |
statistics |
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:
Sentiment |
The kind of task result. |
results |
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 |
The type related to the target. |
TargetRelationType
The type related to the target.
Name | Type | Description |
---|---|---|
assessment |
string |
Assessment relation. |
target |
string |
Target relation. |
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 |