Microsoft Azure Text Analytics Client

Microsoft Azure Text Analytics Client is a powerful tool designed to analyze and extract valuable insights from unstructured text data. By utilizing advanced natural language processing techniques, this client is able to identify key themes, sentiments, and entities within large volumes of text. It can also perform tasks such as language detection, sentiment analysis, and key phrase extraction to help organizations better understand and make informed decisions based on their textual data.

OpenAPI Specification

text-analytics-client-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  version: v3.1-preview.4
  contact:
    name: Microsoft Cognitive Services
    url: >-
      https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/
    email: [email protected]
  title: Microsoft Azure Text Analytics Client
  description: >-
    The Text Analytics API is a suite of natural language processing (NLP)  services built with best-in-class Microsoft machine learning algorithms.  The API can be used to analyze unstructured text for tasks such as sentiment
    analysis, key phrase extraction and language detection. Functionality for
    analysis of text specific to the healthcare domain and personal information
    are also available in the API. Further documentation can be found in <a
    href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview</a>
securityDefinitions:
  apim_key:
    type: apiKey
    name: Ocp-Apim-Subscription-Key
    in: header
security:
  - apim_key: []
x-ms-parameterized-host:
  hostTemplate: '{Endpoint}/text/analytics/v3.1-preview.4'
  useSchemePrefix: false
  parameters:
    - $ref: '#/parameters/Endpoint'
paths:
  /analyze:
    post:
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      description: >-
        Submit a collection of text documents for analysis. Specify one or more
        unique tasks to be executed.
      operationId: microsoftAzureAnalyze
      summary: Microsoft Azure Submit Analysis Job
      parameters:
        - description: Collection of documents to analyze and tasks to execute.
          in: body
          name: body
          schema:
            $ref: '#/definitions/AnalyzeBatchInput'
      responses:
        '202':
          description: >-
            A successful call results with an Operation-Location header used to
            check the status of the analysis job.
          headers:
            Operation-Location:
              type: string
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Submit analysis job request:
          $ref: .//examples//SuccessfulAnalyzeRequest.json
      deprecated: false
      x-ms-long-running-operation: true
      tags:
        - Analyze
  /analyze/jobs/{jobId}:
    get:
      produces:
        - application/json
        - text/json
      description: >-
        Get the status of an analysis job.  A job may consist of one or more
        tasks.  Once all tasks are completed, the job will transition to the
        completed state and results will be available for each task.
      operationId: microsoftAzureAnalyzestatus
      summary: Microsoft Azure Get Analysis Status And Results
      parameters:
        - $ref: '#/parameters/AnalyzeJobId'
        - $ref: '#/parameters/ShowStats'
        - default: 20
          description: >-
            (Optional) Set the maximum number of results per task. When both
            $top and $skip are specified, $skip is applied first.
          in: query
          maximum: 50
          minimum: 1
          name: $top
          type: integer
        - default: 0
          description: >-
            (Optional) Set the number of elements to offset in the response.
            When both $top and $skip are specified, $skip is applied first.
          in: query
          minimum: 0
          name: $skip
          type: integer
      responses:
        '200':
          description: Analysis job status and metadata.
          schema:
            $ref: '#/definitions/AnalyzeJobState'
        '404':
          description: Job ID not found.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Get Analysis job status request:
          $ref: .//examples//SuccessfulAnalyzeStatusRequest.json
      deprecated: false
      tags:
        - Analyze
  /entities/health/jobs/{jobId}:
    get:
      produces:
        - application/json
        - text/json
      description: Get details of the healthcare prediction job specified by the jobId.
      operationId: microsoftAzureHealthstatus
      summary: Microsoft Azure Get Healthcare Analysis Job Status And Results
      parameters:
        - $ref: '#/parameters/JobId'
        - default: 20
          description: >-
            (Optional) Set the maximum number of results per task. When both
            $top and $skip are specified, $skip is applied first.
          in: query
          maximum: 50
          minimum: 1
          name: $top
          type: integer
        - default: 0
          description: >-
            (Optional) Set the number of elements to offset in the response.
            When both $top and $skip are specified, $skip is applied first.
          in: query
          minimum: 0
          name: $skip
          type: integer
        - $ref: '#/parameters/ShowStats'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/HealthcareJobState'
        '404':
          description: Job ID not found.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Health request:
          $ref: .//examples//SuccessfulHealthStatusRequest.json
      deprecated: false
      tags:
        - Entities
    delete:
      produces:
        - application/json
        - text/json
      description: Cancel healthcare prediction job.
      operationId: microsoftAzureCancelhealthjob
      summary: Microsoft Azure Cancel Healthcare Prediction Job
      parameters:
        - $ref: '#/parameters/JobId'
      responses:
        '202':
          description: Cancel Job request has been received.
          headers:
            Operation-Location:
              type: string
        '404':
          description: Job ID not found.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Health request:
          $ref: .//examples//SuccessfulHealthDeleteRequest.json
      deprecated: false
      x-ms-long-running-operation: true
      tags:
        - Entities
  /entities/health/jobs:
    post:
      summary: Microsoft Azure Submit Healthcare Analysis Job
      description: >-
        Start a healthcare analysis job to recognize healthcare related entities
        (drugs, conditions, symptoms, etc) and their relations.
      operationId: microsoftAzureHealth
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      parameters:
        - $ref: '#/parameters/ModelVersion'
        - $ref: '#/parameters/StringIndexType'
        - $ref: '#/parameters/MultiLanguageInput'
      responses:
        '202':
          description: >-
            Accepted - call results in a link where the status of the submitted
            job can be checked via the GET operation.
          headers:
            Operation-Location:
              type: string
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Health request:
          $ref: .//examples//SuccessfulHealthRequest.json
      deprecated: false
      x-ms-long-running-operation: true
      tags:
        - Entities
  /entities/recognition/general:
    post:
      summary: Microsoft Azure Named Entity Recognition
      description: >-
        The API returns a list of general named entities in a given document.
        For the list of supported entity types, check Supported Entity Types in
        Text Analytics API. See the Supported languages in Text Analytics API
        for the list of enabled languages.
      operationId: microsoftAzureEntitiesrecognitiongeneral
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      parameters:
        - $ref: '#/parameters/ModelVersion'
        - $ref: '#/parameters/ShowStats'
        - $ref: '#/parameters/StringIndexType'
        - $ref: '#/parameters/MultiLanguageInput'
      responses:
        '200':
          description: >-
            A successful call results in a list of recognized entities returned
            for each valid document.
          schema:
            $ref: '#/definitions/EntitiesResult'
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Entities request:
          $ref: .//examples//SuccessfulEntitiesRequest.json
      deprecated: false
      tags:
        - Entities
  /entities/recognition/pii:
    post:
      summary: Microsoft Azure Entities Containing Personal Information
      description: >-
        The API returns a list of entities with personal information (\"SSN\",
        \"Bank Account\" etc) in the document. For the list of supported entity
        types, check Supported Entity Types in Text Analytics API. See the
        Supported languages in Text Analytics API for the list of enabled
        languages.<br>
      operationId: microsoftAzureEntitiesrecognitionpii
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      parameters:
        - $ref: '#/parameters/ModelVersion'
        - $ref: '#/parameters/ShowStats'
        - name: domain
          in: query
          description: >-
            (Optional) if specified, will set the PII domain to include only a
            subset of the entity categories. Possible values include: 'PHI',
            'none'.
          type: string
        - $ref: '#/parameters/StringIndexType'
        - $ref: '#/parameters/PiiCategories'
        - $ref: '#/parameters/MultiLanguageInput'
      responses:
        '200':
          description: >-
            A successful call results in a list of entities containing personal
            information returned for each valid document
          schema:
            $ref: '#/definitions/PiiResult'
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Entity PII request:
          $ref: .//examples//SuccessfulEntityPIIRequest.json
      deprecated: false
      tags:
        - Entities
  /entities/linking:
    post:
      summary: Microsoft Azure Linked Entities From A Well Known Knowledge Base
      description: >-
        The API returns a list of recognized entities with links to a well known
        knowledge base. See the Supported languages in Text Analytics API for
        the list of enabled languages.
      operationId: microsoftAzureEntitieslinking
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      parameters:
        - $ref: '#/parameters/ModelVersion'
        - $ref: '#/parameters/ShowStats'
        - $ref: '#/parameters/StringIndexType'
        - $ref: '#/parameters/MultiLanguageInput'
      responses:
        '200':
          description: >-
            A successful call results in a list of recognized entities with
            links to a well known knowledge base returned for each valid
            document
          schema:
            $ref: '#/definitions/EntityLinkingResult'
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Entity Linking request:
          $ref: .//examples//SuccessfulEntityLinkingRequest.json
      deprecated: false
      tags:
        - Entities
  /keyPhrases:
    post:
      summary: Microsoft Azure Key Phrases
      description: >-
        The API returns a list of strings denoting the key phrases in the input
        text. See the Supported languages in Text Analytics API for the list of
        enabled languages.
      operationId: microsoftAzureKeyphrases
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      parameters:
        - $ref: '#/parameters/ModelVersion'
        - $ref: '#/parameters/ShowStats'
        - $ref: '#/parameters/MultiLanguageInput'
      responses:
        '200':
          description: >-
            A successful response results in 0 or more key phrases identified in
            each valid document
          schema:
            $ref: '#/definitions/KeyPhraseResult'
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Key Phrase request:
          $ref: .//examples//SuccessfulKeyPhrasesRequest.json
      deprecated: false
      tags:
        - keyPhrases
  /languages:
    post:
      summary: Microsoft Azure Detect Language
      description: >-
        The API returns the detected language and a numeric score between 0 and
        1. Scores close to 1 indicate 100% certainty that the identified
        language is true. See the Supported languages in Text Analytics API for
        the list of enabled languages.
      operationId: microsoftAzureLanguages
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      parameters:
        - $ref: '#/parameters/ModelVersion'
        - $ref: '#/parameters/ShowStats'
        - $ref: '#/parameters/LanguageInput'
      responses:
        '200':
          description: >-
            A successful call results in the detected language with the highest
            probability for each valid document
          schema:
            $ref: '#/definitions/LanguageResult'
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Detect Language request:
          $ref: .//examples//SuccessfulLanguagesRequest.json
      deprecated: false
      tags:
        - Languages
  /sentiment:
    post:
      summary: Microsoft Azure Sentiment
      description: >-
        The API returns a detailed sentiment analysis for the input text. The
        analysis is done in multiple levels of granularity, start from the a
        document level, down to sentence and key terms (targets and
        assessments).
      operationId: microsoftAzureSentiment
      consumes:
        - application/json
        - text/json
      produces:
        - application/json
        - text/json
      parameters:
        - $ref: '#/parameters/ModelVersion'
        - $ref: '#/parameters/ShowStats'
        - name: opinionMining
          in: query
          description: >-
            (Optional) if set to true, response will contain not only sentiment
            prediction but also opinion mining (aspect-based sentiment analysis)
            results.
          type: boolean
        - $ref: '#/parameters/StringIndexType'
        - $ref: '#/parameters/MultiLanguageInput'
      responses:
        '200':
          description: >-
            A successful call results in a document sentiment prediction, as
            well as sentiment scores for each sentiment class (Positive,
            Negative, and Neutral)
          schema:
            $ref: '#/definitions/SentimentResponse'
        '400':
          description: Bad Request.
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
        '500':
          description: Internal error response
          schema:
            $ref: '#/definitions/ErrorResponse'
          x-ms-error-response: true
      x-ms-examples:
        Successful Sentiment request:
          $ref: .//examples//SuccessfulSentimentRequest.json
      deprecated: false
      tags:
        - Sentiment
definitions:
  JobManifest:
    properties:
      tasks:
        description: >-
          The set of tasks to execute on the input documents. Cannot specify the
          same task more than once.
        properties:
          entityRecognitionTasks:
            type: array
            items:
              $ref: '#/definitions/EntitiesTask'
          entityRecognitionPiiTasks:
            type: array
            items:
              $ref: '#/definitions/PiiTask'
          keyPhraseExtractionTasks:
            type: array
            items:
              $ref: '#/definitions/KeyPhrasesTask'
          entityLinkingTasks:
            type: array
            items:
              $ref: '#/definitions/EntityLinkingTask'
        type: object
    required:
      - tasks
    type: object
  MultiLanguageBatchInput:
    type: object
    required:
      - documents
    properties:
      documents:
        type: array
        description: The set of documents to process as part of this batch.
        items:
          $ref: '#/definitions/MultiLanguageInput'
    description: Contains a set of input documents to be analyzed by the service.
  MultiLanguageInput:
    type: object
    required:
      - id
      - text
    properties:
      id:
        type: string
        description: A unique, non-empty document identifier.
      text:
        type: string
        description: The input text to process.
      language:
        type: string
        description: >-
          (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.
    description: Contains an input document to be analyzed by the service.
  DocumentError:
    type: object
    required:
      - id
      - error
    properties:
      id:
        type: string
        description: Document Id.
      error:
        type: object
        description: Document Error.
        $ref: '#/definitions/TextAnalyticsError'
  ErrorResponse:
    type: object
    required:
      - error
    properties:
      error:
        type: object
        description: Document Error.
        $ref: '#/definitions/TextAnalyticsError'
  TextAnalyticsError:
    type: object
    required:
      - code
      - message
    properties:
      code:
        type: string
        enum:
          - InvalidRequest
          - InvalidArgument
          - InternalServerError
          - ServiceUnavailable
          - NotFound
        x-ms-enum:
          name: ErrorCodeValue
          modelAsString: false
        description: Error code.
      message:
        type: string
        description: Error message.
      target:
        type: string
        description: Error target.
      innererror:
        $ref: '#/definitions/InnerError'
        description: Inner error contains more specific information.
      details:
        type: array
        description: Details about specific errors that led to this reported error.
        items:
          $ref: '#/definitions/TextAnalyticsError'
  TextAnalyticsWarning:
    type: object
    required:
      - code
      - message
    properties:
      code:
        type: string
        enum:
          - LongWordsInDocument
          - DocumentTruncated
        x-ms-enum:
          name: WarningCodeValue
          modelAsString: true
        description: Error code.
      message:
        type: string
        description: Warning message.
      targetRef:
        type: string
        description: A JSON pointer reference indicating the target object.
  PiiTask:
    properties:
      parameters:
        properties:
          domain:
            default: none
            enum:
              - phi
              - none
            type: string
          model-version:
            default: latest
            type: string
          pii-categories:
            $ref: '#/definitions/PiiCategories'
          stringIndexType:
            $ref: '#/definitions/StringIndexType'
        type: object
    type: object
  EntitiesTask:
    properties:
      parameters:
        properties:
          model-version:
            default: latest
            type: string
          stringIndexType:
            $ref: '#/definitions/StringIndexType'
        type: object
    type: object
  InnerError:
    type: object
    required:
      - code
      - message
    properties:
      code:
        type: string
        enum:
          - InvalidParameterValue
          - InvalidRequestBodyFormat
          - EmptyRequest
          - MissingInputRecords
          - InvalidDocument
          - ModelVersionIncorrect
          - InvalidDocumentBatch
          - UnsupportedLanguageCode
          - InvalidCountryHint
        x-ms-enum:
          name: InnerErrorCodeValue
          modelAsString: true
        description: Error code.
      message:
        type: string
        description: Error message.
      details:
        type: object
        additionalProperties:
          type: string
        description: Error details.
      target:
        type: string
        description: Error target.
      innererror:
        $ref: '#/definitions/InnerError'
        description: Inner error contains more specific information.
  AnalyzeBatchInput:
    allOf:
      - $ref: '#/definitions/JobDescriptor'
      - type: object
        required:
          - analysisInput
        properties:
          analysisInput:
            $ref: '#/definitions/MultiLanguageBatchInput'
      - $ref: '#/definitions/JobManifest'
  AnalyzeJobState:
    allOf:
      - $ref: '#/definitions/AnalyzeJobMetadata'
      - $ref: '#/definitions/TasksState'
      - properties:
          errors:
            items:
              $ref: '#/definitions/TextAnalyticsError'
            type: array
          statistics:
            $ref: '#/definitions/RequestStatistics'
        type: object
      - $ref: '#/definitions/Pagination'
  SentimentResponse:
    type: object
    required:
      - documents
      - errors
      - modelVersion
    properties:
      documents:
        type: array
        description: Sentiment analysis per document.
        items:
          $ref: '#/definitions/DocumentSentiment'
      errors:
        type: array
        description: Errors by document id.
        items:
          $ref: '#/definitions/DocumentError'
      statistics:
        $ref: '#/definitions/RequestStatistics'
      modelVersion:
        type: string
        description: This field indicates which model is used for scoring.
  TaskState:
    properties:
      lastUpdateDateTime:
        format: date-time
        type: string
      name:
        type: string
      status:
        enum:
          - notStarted
          - running
          - succeeded
          - failed
          - rejected
          - cancelled
          - cancelling
        x-ms-enum:
          modelAsString: false
          name: State
    required:
      - status
      - lastUpdateDateTime
    type: object
  TasksState:
    properties:
      tasks:
        properties:
          details:
            allOf:
              - $ref: '#/definitions/TaskState'
            type: object
          completed:
            type: integer
          failed:
            type: integer
          inProgress:
            type: integer
          total:
            type: integer
          entityRecognitionTasks:
            type: array
            items:
              type: object
              allOf:
                - $ref: '#/definitions/TaskState'
                - type: object
                  properties:
                    results:
                      $ref: '#/definitions/EntitiesResult'
          entityRecognitionPiiTasks:
            type: array
            items:
              type: object
              allOf:
                - $ref: '#/definitions/TaskState'
                - type: object
                  properties:
                    results:
                      $ref: '#/definitions/PiiResult'
          keyPhraseExtractionTasks:
            type: array
            items:
              type: object
              allOf:
                - $ref: '#/definitions/TaskState'
                - type: object
                  properties:
                    results:
                      $ref: '#/definitions/KeyPhraseResult'
          entityLinkingTasks:
            type: array
            items:
              type: object
              allOf:
                - $ref: '#/definitions/TaskState'
                - type: object
                  properties:
                    results:
                      $ref: '#/definitions/EntityLinkingResult'
        required:
          - total
          - completed
          - failed
          - inProgress
        type: object
    required:
      - tasks
    type: object
  DocumentSentiment:
    type: object
    required:
      - id
      - sentiment
      - confidenceScores
      - sentences
      - warnings
    properties:
      id:
        type: string
        description: Unique, non-empty document identifier.
      sentiment:
        type: string
        description: >-
          Predicted sentiment for document (Negative, Neutral, Positive, or
          Mixed).
        enum:
          - positive
          - neutral
          - negative
          - mixed
        x-ms-enum:
          name: DocumentSentimentValue
          modelAsString: false
      statistics:
        $ref: '#/definitions/DocumentStatistics'
      confidenceScores:
        description: >-
          Document level sentiment confidence scores between 0 and 1 for each
          sentiment class.
        $ref: '#/definitions/SentimentConfidenceScorePerLabel'
      sentences:
        type: array
        description: Sentence level sentiment analysis.
        items:
          $ref: '#/definitions/SentenceSentiment'
      warnings:
        type: array
        description: Warnings encountered while processing document.
        items:
          $ref: '#/definitions/TextAnalyticsWarning'
  RequestStatistics:
    type: object
    required:
      - documentsCount
      - validDocumentsCount
      - erroneousDocumentsCount
      - transactionsCount
    properties:
      documentsCount:
        type: integer
        format: int32
        description: Number of documents submitted in the request.
      validDocumentsCount:
        type: integer
        format: int32
        description: >-
          Number of valid documents. This excludes empty, over-size limit or
          non-supported languages documents.
      erroneousDocumentsCount:
        type: integer
        format: int32
        description: >-
          Number of invalid documents. This includes empty, over-size limit or
          non-supported languages documents.
      transactionsCount:
        type: integer
        format: int64
        description: Number of transactions for the request.
    description: >-
      if showStats=true was specified in the request this field will contain
      information about the request payload.
  DocumentStatistics:
    type: object
    required:
      - charactersCount
      - transactionsCount
    properties:
      charactersCount:
        type: integer
        format: int32
        description: Number of text elements recognized in the document.
      transactionsCount:
        type: integer
        format: int32
        description: Number of transactions for the document.
    description: >-
      if showStats=true was specified in the request this field will contain
      information about the document payload.
  SentimentConfidenceScorePerLabel:
    type: object
    required:
      - positive
      - neutral
      - negative
    properties:
      positive:
        type: number
        format: double
      neutral:
        type: number
        format: double
      negative:
        type: number
        format: double
    description: >-
      Represents the confidence scores between 0 and 1 across all sentiment
      classes: positive, neutral, negative.
  SentenceSentiment:
    type: object
    required:
      - text
      - sentiment
      - confidenceScores
      - offset
      - length
    properties:
      text:
        type: string
        description: The sentence text.
      sentiment:
        type: string
        description: The predicted Sentiment for the sentence.
        enum:
          - positive
          - neutral
          - negative
        x-ms-enum:
          name: SentenceSentimentValue
          modelAsString: false
      confidenceScores:
        description: >-
          The sentiment confidence score between 0 and 1 for the sentence for
          all classes.
        $ref: '#/definitions/SentimentConfidenceScorePerLabel'
      offset:
        type: integer
        format: int32
        description: The sentence offset from the start of the document.
      length:
        type: integer
        format: int32
        description: The length of the sentence.
      targets:
        type: array
        description: The array of sentence targets for the sentence.
        items:
          $ref: '#/definitions/SentenceTarget'
      assessments:
        type: array
        description: The array of assessments for the sentence.
        items:
          $ref: '#/definitions/SentenceAssessment'
  SentenceTarget:
    type: object
    required:
      - confidenceScores
      - length
      - offset
      - relations
      - sentiment
      - text
    properties:
      sentiment:
        type: string
        enum:
          - positive
          - mixed
          - negative
        x-ms-enum:
          name: TokenSentimentValue
          modelAsString: false
        description: Targeted sentiment in the sentence.
      confidenceScores:
        description: Target sentiment confidence scores for the target in the sentence.
        $ref: '#/definitions/TargetConfidenceScoreLabel'
      offset:
        type: integer
        format: int32
        description: The target offset from the start of the sentence.
      length:
        type: integer
        format: int32
        description: The length of the target.
      text:
        type: string
        description: The target text detected.
      relations:
        type: array
        description: >-
          The array of either assessment or target objects which is related to
          the target.
        items:
          $ref: '#/definitions/TargetRelation'
  SentenceAssessment:
    type: object
    required:
      - confidenceScores
      - isNegated
      - length
      - offset
      - sentiment
      - text
    properties:
      sentiment:
        type: string
        enum:
          - positive
          - mixed
          - negative
        x-ms-enum:
          name: TokenSentimentValue
          modelAsString: false
        description: Assessment sentiment

# --- truncated at 32 KB (66 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/microsoft-azure/refs/heads/main/openapi/text-analytics-client-openapi-original.yml