Text Analysis Runtime - Analyze Text

Request text analysis over a collection of documents.
Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.

POST {Endpoint}/language/:analyze-text?api-version=2022-05-01
POST {Endpoint}/language/:analyze-text?api-version=2022-05-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

Client API version.

showStats
query
  • boolean

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

Request Header

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

A subscription key for a Language service resource.

Request Body

The request body can be one of the following:

Name Description
AnalyzeTextEntityLinkingInput
AnalyzeTextEntityRecognitionInput
AnalyzeTextKeyPhraseExtractionInput
AnalyzeTextLanguageDetectionInput
AnalyzeTextPiiEntitiesRecognitionInput
AnalyzeTextSentimentAnalysisInput

AnalyzeTextEntityLinkingInput

Name Required Type Description
kind True string:
  • EntityLinking

Enumeration of supported Text Analysis tasks.

analysisInput
parameters

Supported parameters for an Entity Linking task.

AnalyzeTextEntityRecognitionInput

Name Required Type Description
kind True string:
  • EntityRecognition

Enumeration of supported Text Analysis tasks.

analysisInput
parameters

Supported parameters for an Entity Recognition task.

AnalyzeTextKeyPhraseExtractionInput

Name Required Type Description
kind True string:
  • KeyPhraseExtraction

Enumeration of supported Text Analysis tasks.

analysisInput
parameters

Supported parameters for a Key Phrase Extraction task.

AnalyzeTextLanguageDetectionInput

Name Required Type Description
kind True string:
  • LanguageDetection

Enumeration of supported Text Analysis tasks.

analysisInput
parameters

Supported parameters for a Language Detection task.

AnalyzeTextPiiEntitiesRecognitionInput

Name Required Type Description
kind True string:
  • PiiEntityRecognition

Enumeration of supported Text Analysis tasks.

analysisInput
parameters

Supported parameters for a PII Entities Recognition task.

AnalyzeTextSentimentAnalysisInput

Name Required Type Description
kind True string:
  • SentimentAnalysis

Enumeration of supported Text Analysis tasks.

analysisInput
parameters

Supported parameters for a Sentiment Analysis task.

Responses

Name Type Description
200 OK AnalyzeTextTaskResult:

A successful call result

Other Status Codes

Unexpected error

Security

Ocp-Apim-Subscription-Key

A subscription key for a Language service resource.

Type: apiKey
In: header

Examples

Successful Entity Linking Request
Successful Entity Recognition Request
Successful Key Phrase Extraction Request
Successful Language Detection Request
Successful PII Entity Recognition Request
Successful Sentiment Analysis Request

Successful Entity Linking Request

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2022-05-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"
  }
}

Successful Entity Recognition Request

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2022-05-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"
  }
}

Successful Key Phrase Extraction Request

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2022-05-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": "2019-10-01"
  }
}

Successful Language Detection Request

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2022-05-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"
      }
    ]
  }
}

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": []
      }
    ],
    "errors": [],
    "modelVersion": "2020-04-01"
  }
}

Successful PII Entity Recognition Request

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2022-05-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": "U.S. Social Security Number (SSN)",
            "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": "ABA Routing Number",
            "confidenceScore": 0.75,
            "length": 9,
            "offset": 18,
            "text": "111000025"
          }
        ],
        "warnings": []
      },
      {
        "id": "3",
        "redactedText": "Is ************** your Brazilian CPF number?",
        "entities": [
          {
            "category": "Brazil CPF Number",
            "confidenceScore": 0.85,
            "length": 14,
            "offset": 3,
            "text": "998.214.865-68"
          }
        ],
        "warnings": []
      }
    ],
    "errors": [],
    "modelVersion": "2019-10-01"
  }
}

Successful Sentiment Analysis Request

Sample Request

POST {Endpoint}/language/:analyze-text?api-version=2022-05-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": "2020-04-01"
  }
}

Definitions

AnalyzeTextEntityLinkingInput
AnalyzeTextEntityRecognitionInput
AnalyzeTextKeyPhraseExtractionInput
AnalyzeTextLanguageDetectionInput
AnalyzeTextPiiEntitiesRecognitionInput
AnalyzeTextSentimentAnalysisInput
AnalyzeTextTaskKind

Enumeration of supported Text Analysis tasks.

AnalyzeTextTaskResultsKind

Enumeration of supported Text Analysis task results.

DetectedLanguage
DocumentError
Documents

Response by document

DocumentStatistics

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

DocumentWarning
EntitiesResult
EntitiesTaskParameters

Supported parameters for an Entity Recognition task.

EntitiesTaskResult
Entity
EntityLinkingResult
EntityLinkingTaskParameters

Supported parameters for an Entity Linking task.

EntityLinkingTaskResult
Error

The error object.

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
KeyPhraseTaskParameters

Supported parameters for a Key Phrase Extraction task.

KeyPhraseTaskResult
LanguageDetectionAnalysisInput
LanguageDetectionDocumentResult
LanguageDetectionResult
LanguageDetectionTaskParameters

Supported parameters for a Language Detection task.

LanguageDetectionTaskResult
LanguageInput
MultiLanguageAnalysisInput
MultiLanguageInput

Contains an input document to be analyzed by the service.

PiiDomain

The PII domain used for PII Entity Recognition.

PiiResult
PiiTaskParameters

Supported parameters for a PII Entities Recognition task.

PiiTaskResult
RequestStatistics

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

SentimentAnalysisTaskParameters

Supported parameters for a Sentiment Analysis task.

SentimentResponse
SentimentTaskResult
StringIndexType

Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.

WarningCodeValue

Error code.

AnalyzeTextEntityLinkingInput

Name Type Description
analysisInput
kind string:
  • EntityLinking

Enumeration of supported Text Analysis tasks.

parameters

Supported parameters for an Entity Linking task.

AnalyzeTextEntityRecognitionInput

Name Type Description
analysisInput
kind string:
  • EntityRecognition

Enumeration of supported Text Analysis tasks.

parameters

Supported parameters for an Entity Recognition task.

AnalyzeTextKeyPhraseExtractionInput

Name Type Description
analysisInput
kind string:
  • KeyPhraseExtraction

Enumeration of supported Text Analysis tasks.

parameters

Supported parameters for a Key Phrase Extraction task.

AnalyzeTextLanguageDetectionInput

Name Type Description
analysisInput
kind string:
  • LanguageDetection

Enumeration of supported Text Analysis tasks.

parameters

Supported parameters for a Language Detection task.

AnalyzeTextPiiEntitiesRecognitionInput

Name Type Description
analysisInput
kind string:
  • PiiEntityRecognition

Enumeration of supported Text Analysis tasks.

parameters

Supported parameters for a PII Entities Recognition task.

AnalyzeTextSentimentAnalysisInput

Name Type Description
analysisInput
kind string:
  • SentimentAnalysis

Enumeration of supported Text Analysis tasks.

parameters

Supported parameters for a Sentiment Analysis task.

AnalyzeTextTaskKind

Enumeration of supported Text Analysis tasks.

Name Type Description
EntityLinking
  • string
EntityRecognition
  • string
KeyPhraseExtraction
  • string
LanguageDetection
  • string
PiiEntityRecognition
  • string
SentimentAnalysis
  • string

AnalyzeTextTaskResultsKind

Enumeration of supported Text Analysis task results.

Name Type Description
EntityLinkingResults
  • string
EntityRecognitionResults
  • string
KeyPhraseExtractionResults
  • string
LanguageDetectionResults
  • string
PiiEntityRecognitionResults
  • string
SentimentAnalysisResults
  • string

DetectedLanguage

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

Name Type Description
error

Document Error.

id
  • string

Document Id.

Documents

Response by document

Name Type Description
entities

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.

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

Name Type Description
code

Error code.

message
  • string

Warning message.

targetRef
  • string

A JSON pointer reference indicating the target object.

EntitiesResult

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
modelVersion
  • string
latest
stringIndexType TextElements_v8

Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.

EntitiesTaskResult

Name Type Description
kind string:
  • EntityRecognitionResults

Enumeration of supported Text Analysis task results.

results

Entity

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

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
modelVersion
  • string
latest
stringIndexType TextElements_v8

Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.

EntityLinkingTaskResult

Name Type Description
kind string:
  • EntityLinkingResults

Enumeration of supported Text Analysis task results.

results

Error

The error object.

Name Type Description
code

One of a server-defined set of error codes.

details

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
AzureCognitiveSearchIndexNotFound
  • string
AzureCognitiveSearchNotFound
  • string
AzureCognitiveSearchThrottling
  • string
Conflict
  • string
Forbidden
  • string
InternalServerError
  • string
InvalidArgument
  • string
InvalidRequest
  • string
NotFound
  • string
OperationNotFound
  • string
ProjectNotFound
  • string
QuotaExceeded
  • string
ServiceUnavailable
  • string
Timeout
  • string
TooManyRequests
  • string
Unauthorized
  • string
Warning
  • string

ErrorResponse

Error response.

Name Type Description
error

The error object.

InnerErrorCode

Human-readable error code.

Name Type Description
AzureCognitiveSearchNotFound
  • string
AzureCognitiveSearchThrottling
  • string
EmptyRequest
  • string
ExtractionFailure
  • string
InvalidCountryHint
  • string
InvalidDocument
  • string
InvalidDocumentBatch
  • string
InvalidParameterValue
  • string
InvalidRequest
  • string
InvalidRequestBodyFormat
  • string
KnowledgeBaseNotFound
  • string
MissingInputDocuments
  • string
ModelVersionIncorrect
  • string
UnsupportedLanguageCode
  • string

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

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.

KeyPhraseTaskParameters

Supported parameters for a Key Phrase Extraction task.

Name Type Default Value Description
loggingOptOut
  • boolean
False
modelVersion
  • string
latest

KeyPhraseTaskResult

Name Type Description
kind string:
  • KeyPhraseExtractionResults

Enumeration of supported Text Analysis task results.

results

LanguageDetectionAnalysisInput

Name Type Description
documents

LanguageDetectionDocumentResult

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

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.

LanguageDetectionTaskParameters

Supported parameters for a Language Detection task.

Name Type Default Value Description
loggingOptOut
  • boolean
False
modelVersion
  • string
latest

LanguageDetectionTaskResult

Name Type Description
kind string:
  • LanguageDetectionResults

Enumeration of supported Text Analysis task results.

results

LanguageInput

Name Type Description
countryHint
  • string
id
  • string

Unique, non-empty document identifier.

text
  • string

MultiLanguageAnalysisInput

Name Type Description
documents

Contains an input document to be analyzed by the service.

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.

text
  • string

The input text to process.

PiiDomain

The PII domain used for PII Entity Recognition.

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.

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

The PII domain used for PII Entity Recognition.

loggingOptOut
  • boolean
False
modelVersion
  • string
latest
piiCategories
  • string[]

(Optional) describes the PII categories to return

stringIndexType TextElements_v8

Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.

PiiTaskResult

Name Type Description
kind string:
  • PiiEntityRecognitionResults

Enumeration of supported Text Analysis task results.

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.

SentimentAnalysisTaskParameters

Supported parameters for a Sentiment Analysis task.

Name Type Default Value Description
loggingOptOut
  • boolean
False
modelVersion
  • string
latest
opinionMining
  • boolean
False
stringIndexType TextElements_v8

Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.

SentimentResponse

Name Type Description
documents

Sentiment analysis per 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.

SentimentTaskResult

Name Type Description
kind string:
  • SentimentAnalysisResults

Enumeration of supported Text Analysis task results.

results

StringIndexType

Specifies the method used to interpret string offsets. Defaults to Text Elements (Graphemes) according to Unicode v8.0.0. For additional information see https://aka.ms/text-analytics-offsets.

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.

WarningCodeValue

Error code.

Name Type Description
DocumentTruncated
  • string
LongWordsInDocument
  • string