Microsoft Azure Microsoft Cognitive Language Service Text Analysis

Microsoft Azure Cognitive Language Service Text Analysis is a powerful tool that allows users to extract valuable insights and meaning from large volumes of text data. Using advanced machine learning algorithms, the service can automatically detect sentiment, key phrases, entities, and language from a variety of sources such as social media, customer reviews, and documents.

OpenAPI Specification

microsoft-cognitive-language-service-text-analysis-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  title: Microsoft Azure Microsoft Cognitive Language Service - Text Analysis
  description: >-
    The language service API is a suite of natural language processing (NLP)
    skills 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, language detection and question answering.
    Further documentation can be found in <a
    href="https://docs.microsoft.com/azure/cognitive-services/language-service/overview">https://docs.microsoft.com/azure/cognitive-services/language-service/overview</a>.0
  version: 2023-04-15-preview
securityDefinitions:
  AADToken:
    type: oauth2
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    flow: implicit
    description: >-
      These are the [Azure Active Directory
      OAuth2](https://docs.microsoft.com/azure/active-directory/develop/v1-overview)
      Flows. When paired with [Azure role-based
      access](https://docs.microsoft.com/azure/role-based-access-control/overview)
      control it can be used to control access to Azure Maps REST APIs. Azure
      role-based access controls are used to designate access to one or more
      Azure Maps resource account or sub-resources. Any user, group, or service
      principal can be granted access via a  built-in role or a custom role
      composed of one or more permissions to Azure Maps REST APIs.


      To implement scenarios, we recommend viewing [authentication
      concepts](https://aka.ms/amauth). In summary, this security definition
      provides a solution for modeling application(s) via objects capable of
      access control on specific APIs and scopes.


      #### Notes

      * This security definition **requires** the use of the `x-ms-client-id`
      header to indicate which Azure Maps resource the application is requesting
      access to. This can be acquired from the [Maps management
      API](https://aka.ms/amauthdetails).

      * 

      The `Authorization URL` is specific to the Azure public cloud instance.
      Sovereign clouds have unique Authorization URLs and Azure Active directory
      configurations. 

      * 

      The Azure role-based access control is configured from the [Azure
      management plane](https://aka.ms/amrbac) via Azure portal, PowerShell,
      CLI, Azure SDKs, or REST APIs.

      * 

      Usage of the [Azure Maps Web SDK](https://aka.ms/amaadmc) allows for
      configuration based setup of an application for multiple use cases.

      * Currently, Azure Active Directory [v1.0 or
      v2.0](https://docs.microsoft.com/azure/active-directory/develop/azure-ad-endpoint-comparison)
      supports Work, School, and Guests but does not support Personal accounts.
    scopes:
      https://cognitiveservices.azure.com/.default: https://cognitiveservices.azure.com/.default
  apim_key:
    type: apiKey
    description: A subscription key for a Language service resource.
    name: Ocp-Apim-Subscription-Key
    in: header
security:
  - AADToken:
      - https://cognitiveservices.azure.com/.default
  - apim_key: []
x-ms-parameterized-host:
  hostTemplate: '{Endpoint}/language'
  useSchemePrefix: false
  parameters:
    - $ref: common.json#/parameters/Endpoint
paths:
  /:analyze-text:
    post:
      summary: 'Microsoft Azure Request Text Analysis Over A Collection Of Documents'
      description: >-
        Submit a collection of text documents for analysis.  Specify a single
        unique task to be executed immediately.
      operationId: microsoftAzureAnalyzetext
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: common.json#/parameters/ApiVersionParameter
        - $ref: common.json#/parameters/ShowStats
        - description: Collection of documents to analyze and a single task to execute.
          in: body
          name: body
          schema:
            $ref: '#/definitions/AnalyzeTextTask'
          required: true
      responses:
        '200':
          description: A successful call result
          schema:
            $ref: '#/definitions/AnalyzeTextTaskResult'
        default:
          description: Unexpected error
          schema:
            $ref: common.json#/definitions/ErrorResponse
      x-ms-examples:
        Successful Entity Linking Request:
          $ref: ./examples/text/SuccessfulEntityLinkingRequest.json
        Successful Entity Recognition Request:
          $ref: ./examples/text/SuccessfulEntityRecognitionRequest.json
        Successful Entity Recognition Inclusion Request:
          $ref: ./examples/text/SuccessfulEntityRecognitionInclusionRequest.json
        Successful Entity Recognition Exclusion Request:
          $ref: ./examples/text/SuccessfulEntityRecognitionExclusionRequest.json
        Successful Entity Recognition Overlap Policy Request:
          $ref: ./examples/text/SuccessfulEntityRecognitionOverlapPolicy.json
        Successful Key Phrase Extraction Request:
          $ref: ./examples/text/SuccessfulKeyPhraseExtractionRequest.json
        Successful PII Entity Recognition Request:
          $ref: ./examples/text/SuccessfulPiiEntityRecognitionRequest.json
        Successful PII Entity Recognition Redaction Request:
          $ref: ./examples/text/SuccessfulPiiEntityRecognitionRedactionRequest.json
        Successful PII Entity Recognition Exclusion Request:
          $ref: ./examples/text/SuccessfulPiiEntityRecognitionExclusionRequest.json
        Successful Language Detection Request:
          $ref: ./examples/text/SuccessfulLanguageDetectionRequest.json
        Successful Sentiment Analysis Request:
          $ref: ./examples/text/SuccessfulSentimentAnalysisRequest.json
        Successful Dynamic Classification Request:
          $ref: ./examples/text/SuccessfuDynamicClassificationRequest.json
      tags:
        - :Analyze Text
  /analyze-text/jobs:
    post:
      consumes:
        - application/json
      produces:
        - application/json
      description: >-
        Submit a collection of text documents for analysis. Specify one or more
        unique tasks to be executed as a long-running operation.
      operationId: microsoftAzureAnalyzetextSubmitjob
      summary: Microsoft Azure Submit Text Analysis Job
      parameters:
        - $ref: common.json#/parameters/ApiVersionParameter
        - description: Collection of documents to analyze and one or more tasks to execute.
          in: body
          name: body
          schema:
            $ref: '#/definitions/AnalyzeTextJobsInput'
          required: true
      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
        default:
          description: Error response.
          schema:
            $ref: common.json#/definitions/ErrorResponse
      x-ms-examples:
        Successful Submit Analysis Job Request:
          $ref: >-
            ./examples/text/SuccessfulAnalyzeTextJobsMultipleTaskSubmitRequest.json
        Successful Healthcare Post Request:
          $ref: ./examples/text/SuccessfulHealthcarePostRequest.json
        Successful Custom Healthcare Post Request:
          $ref: ./examples/text/SuccessfulCustomHealthcarePostRequest.json
        Successful Submit Abstractive Summarization Task:
          $ref: ./examples/text/SuccessfulAbstractiveSummarizationTaskSubmit.json
        Successful Submit Custom Abstractive Summarization Task:
          $ref: >-
            ./examples/text/SuccessfulCustomAbstractiveSummarizationTaskSubmit.json
        Successful Healthcare DocumentType Post Request:
          $ref: ./examples/text/SuccessfulHealthcareDocumentTypePostRequest.json
        Successful Custom Sentiment Analysis Post Request:
          $ref: ./examples/text/SuccessfulCustomSentimentAnalysisTaskSubmit.json
      x-ms-long-running-operation: true
      tags:
        - Analyze Text
  /analyze-text/jobs/{jobId}:
    get:
      produces:
        - application/json
      description: >-
        Get the status of an analysis job.  A job may consist of one or more
        tasks.  Once all tasks are succeeded, the job will transition to the
        succeeded state and results will be available for each task.
      operationId: microsoftAzureAnalyzetextJobstatus
      summary: Microsoft Azure Get Analysis Status And Results
      parameters:
        - $ref: common.json#/parameters/ApiVersionParameter
        - $ref: common.json#/parameters/JobId
        - $ref: common.json#/parameters/ShowStats
        - $ref: common.json#/parameters/TopParameter
        - $ref: common.json#/parameters/SkipParameter
      responses:
        '200':
          description: Analysis job status and metadata.
          schema:
            $ref: '#/definitions/AnalyzeTextJobState'
        default:
          description: Unexpected error
          schema:
            $ref: common.json#/definitions/ErrorResponse
      x-ms-examples:
        Successful Get Text Analysis Job Status Request:
          $ref: >-
            ./examples/text/SuccessfulAnalyzeTextJobsMultipleTaskStatusRequest.json
        Successful Get Text Analysis Health Request:
          $ref: ./examples/text/SuccessfulHealthcareTaskStatusRequest.json
        Successful Get Text Analysis Custom Health Request:
          $ref: ./examples/text/SuccessfulCustomHealthcareTaskStatusRequest.json
        Successful Get Abstractive Summarization Result:
          $ref: ./examples/text/SuccessfulAbstractiveSummarizationTaskResult.json
        Successful Get Custom Abstractive Summarization Result:
          $ref: >-
            ./examples/text/SuccessfulCustomAbstractiveSummarizationTaskResult.json
        Successful Get Text Analysis Health DocumentType Request:
          $ref: >-
            ./examples/text/SuccessfulHealthcareDocumentTypeTaskStatusRequest.json
        Successful Get Text Analysis Custom Sentiment Analysis Request:
          $ref: >-
            ./examples/text/SuccessfulCustomSentimentAnalysisTaskStatusRequest.json
      tags:
        - Analyze Text
  /analyze-text/jobs/{jobId}:cancel:
    post:
      produces:
        - application/json
      description: Cancel a long-running Text Analysis job.
      operationId: microsoftAzureAnalyzetextCanceljob
      summary: Microsoft Azure Cancel A Long Running Text Analysis Job
      parameters:
        - $ref: common.json#/parameters/ApiVersionParameter
        - $ref: common.json#/parameters/JobId
      responses:
        '202':
          description: Cancel Job request has been received.
          headers:
            Operation-Location:
              type: string
        default:
          description: Unexpected error
          schema:
            $ref: common.json#/definitions/ErrorResponse
      x-ms-examples:
        Successful Job Delete Request:
          $ref: ./examples/text/SuccessfulAnalyzeTextJobsCancelRequest.json
      x-ms-long-running-operation: true
      tags:
        - Analyze Text
definitions:
  AnalyzeTextTaskKind:
    type: string
    description: Enumeration of supported Text Analysis tasks.
    enum:
      - SentimentAnalysis
      - EntityRecognition
      - PiiEntityRecognition
      - KeyPhraseExtraction
      - LanguageDetection
      - EntityLinking
      - DynamicClassification
    x-ms-enum:
      name: AnalyzeTextTaskKind
      modelAsString: true
  AnalyzeTextLROTaskKind:
    type: string
    description: Enumeration of supported long-running Text Analysis tasks.
    enum:
      - SentimentAnalysis
      - EntityRecognition
      - PiiEntityRecognition
      - KeyPhraseExtraction
      - EntityLinking
      - Healthcare
      - CustomHealthcare
      - ExtractiveSummarization
      - CustomEntityRecognition
      - CustomSingleLabelClassification
      - CustomMultiLabelClassification
      - AbstractiveSummarization
      - CustomSentimentAnalysis
      - CustomAbstractiveSummarization
    x-ms-enum:
      name: AnalyzeTextLROTaskKind
      modelAsString: true
  AnalyzeTextTaskResultsKind:
    type: string
    description: Enumeration of supported Text Analysis task results.
    enum:
      - SentimentAnalysisResults
      - EntityRecognitionResults
      - PiiEntityRecognitionResults
      - KeyPhraseExtractionResults
      - LanguageDetectionResults
      - EntityLinkingResults
      - DynamicClassificationResults
    x-ms-enum:
      name: AnalyzeTextTaskResultsKind
      modelAsString: true
  AnalyzeTextLROResultsKind:
    type: string
    description: >-
      Enumeration of supported Text Analysis long-running operation task
      results.
    enum:
      - SentimentAnalysisLROResults
      - EntityRecognitionLROResults
      - PiiEntityRecognitionLROResults
      - KeyPhraseExtractionLROResults
      - EntityLinkingLROResults
      - HealthcareLROResults
      - CustomHealthcareLROResults
      - ExtractiveSummarizationLROResults
      - CustomEntityRecognitionLROResults
      - CustomSingleLabelClassificationLROResults
      - CustomMultiLabelClassificationLROResults
      - AbstractiveSummarizationLROResults
      - CustomSentimentAnalysisLROResults
      - CustomAbstractiveSummarizationLROResults
    x-ms-enum:
      name: AnalyzeTextLROResultsKind
      modelAsString: true
  MultiLanguageAnalysisInput:
    type: object
    properties:
      documents:
        type: array
        items:
          $ref: '#/definitions/MultiLanguageInput'
  LanguageDetectionAnalysisInput:
    type: object
    properties:
      documents:
        type: array
        items:
          $ref: '#/definitions/LanguageInput'
  AnalyzeTextTask:
    type: object
    discriminator: kind
    required:
      - kind
    properties:
      kind:
        $ref: '#/definitions/AnalyzeTextTaskKind'
  AnalyzeTextLROTask:
    type: object
    discriminator: kind
    required:
      - kind
    properties:
      kind:
        $ref: '#/definitions/AnalyzeTextLROTaskKind'
    allOf:
      - $ref: common.json#/definitions/TaskIdentifier
  AnalyzeTextTaskResult:
    type: object
    discriminator: kind
    required:
      - kind
    properties:
      kind:
        $ref: '#/definitions/AnalyzeTextTaskResultsKind'
  AnalyzeTextEntityLinkingInput:
    type: object
    properties:
      analysisInput:
        $ref: '#/definitions/MultiLanguageAnalysisInput'
      parameters:
        $ref: '#/definitions/EntityLinkingTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextTask'
    x-ms-discriminator-value: EntityLinking
  AnalyzeTextEntityRecognitionInput:
    type: object
    properties:
      analysisInput:
        $ref: '#/definitions/MultiLanguageAnalysisInput'
      parameters:
        $ref: '#/definitions/EntitiesTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextTask'
    x-ms-discriminator-value: EntityRecognition
  AnalyzeTextKeyPhraseExtractionInput:
    type: object
    properties:
      analysisInput:
        $ref: '#/definitions/MultiLanguageAnalysisInput'
      parameters:
        $ref: '#/definitions/KeyPhraseTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextTask'
    x-ms-discriminator-value: KeyPhraseExtraction
  AnalyzeTextPiiEntitiesRecognitionInput:
    type: object
    properties:
      analysisInput:
        $ref: '#/definitions/MultiLanguageAnalysisInput'
      parameters:
        $ref: '#/definitions/PiiTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextTask'
    x-ms-discriminator-value: PiiEntityRecognition
  AnalyzeTextLanguageDetectionInput:
    type: object
    properties:
      analysisInput:
        $ref: '#/definitions/LanguageDetectionAnalysisInput'
      parameters:
        $ref: '#/definitions/LanguageDetectionTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextTask'
    x-ms-discriminator-value: LanguageDetection
  AnalyzeTextSentimentAnalysisInput:
    type: object
    properties:
      analysisInput:
        $ref: '#/definitions/MultiLanguageAnalysisInput'
      parameters:
        $ref: '#/definitions/SentimentAnalysisTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextTask'
    x-ms-discriminator-value: SentimentAnalysis
  AnalyzeTextDynamicClassificationInput:
    type: object
    properties:
      analysisInput:
        $ref: '#/definitions/MultiLanguageAnalysisInput'
      parameters:
        $ref: '#/definitions/DynamicClassificationTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextTask'
    x-ms-discriminator-value: DynamicClassification
  AnalyzeTextJobsInput:
    type: object
    properties:
      displayName:
        description: Optional display name for the analysis job.
        type: string
      defaultLanguage:
        description: >-
          Default language to use for records requesting automatic language
          detection.
        type: string
      analysisInput:
        $ref: '#/definitions/MultiLanguageAnalysisInput'
      tasks:
        description: The set of tasks to execute on the input documents.
        type: array
        items:
          $ref: '#/definitions/AnalyzeTextLROTask'
    required:
      - analysisInput
      - tasks
  CustomEntitiesTaskParameters:
    type: object
    description: Supported parameters for a Custom Entities task.
    properties:
      stringIndexType:
        $ref: common.json#/definitions/StringIndexType
    allOf:
      - $ref: common.json#/definitions/CustomTaskParameters
  CustomEntitiesLROTask:
    type: object
    description: >-
      Use custom models to ease the process of information extraction from
      unstructured documents like contracts or financial documents
    properties:
      parameters:
        $ref: '#/definitions/CustomEntitiesTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextLROTask'
    x-ms-discriminator-value: CustomEntityRecognition
  CustomEntitiesResult:
    type: object
    properties:
      documents:
        type: array
        description: Response by document
        items:
          allOf:
            - $ref: '#/definitions/EntitiesDocumentResult'
            - $ref: '#/definitions/DocumentDetectedLanguage'
    allOf:
      - $ref: common.json#/definitions/CustomResult
    required:
      - documents
  CustomSingleLabelClassificationTaskParameters:
    type: object
    description: Supported parameters for a Custom Single Classification task.
    allOf:
      - $ref: common.json#/definitions/CustomTaskParameters
  CustomSingleLabelClassificationLROTask:
    type: object
    description: Use custom models to classify text into single label taxonomy
    properties:
      parameters:
        $ref: '#/definitions/CustomSingleLabelClassificationTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextLROTask'
    x-ms-discriminator-value: CustomSingleLabelClassification
  CustomLabelClassificationResult:
    type: object
    properties:
      documents:
        type: array
        description: Response by document
        items:
          allOf:
            - $ref: '#/definitions/ClassificationDocumentResult'
            - $ref: '#/definitions/DocumentDetectedLanguage'
    allOf:
      - $ref: common.json#/definitions/CustomResult
    required:
      - documents
  ClassificationResult:
    type: object
    required:
      - category
      - confidenceScore
    properties:
      category:
        type: string
        description: Classification type.
      confidenceScore:
        type: number
        format: double
        description: Confidence score between 0 and 1 of the recognized class.
  CustomMultiLabelClassificationTaskParameters:
    type: object
    description: Supported parameters for a Custom Multi Classification task.
    allOf:
      - $ref: common.json#/definitions/CustomTaskParameters
  CustomMultiLabelClassificationLROTask:
    type: object
    description: Use custom models to classify text into multi label taxonomy
    properties:
      parameters:
        $ref: '#/definitions/CustomMultiLabelClassificationTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextLROTask'
    x-ms-discriminator-value: CustomMultiLabelClassification
  ClassificationDocumentResult:
    type: object
    properties:
      class:
        type: array
        items:
          $ref: '#/definitions/ClassificationResult'
    allOf:
      - $ref: '#/definitions/DocumentResult'
    required:
      - class
  DynamicClassificationDocumentResult:
    type: object
    properties:
      classifications:
        type: array
        items:
          $ref: '#/definitions/ClassificationResult'
    allOf:
      - $ref: '#/definitions/DocumentResult'
    required:
      - classifications
  HealthcareTaskParameters:
    type: object
    description: Supported parameters for a Healthcare task.
    properties:
      fhirVersion:
        type: string
        description: >-
          The FHIR Spec version that the result will use to format the
          fhirBundle. For additional information see
          https://www.hl7.org/fhir/overview.html.
        enum:
          - 4.0.1
        x-ms-enum:
          name: fhirVersion
          modelAsString: true
      documentType:
        x-ms-enum:
          name: healthcareDocumentType
          modelAsString: true
        type: string
        description: >-
          Document type that can be provided as input for Fhir Documents. Expect
          to have fhirVersion provided when used. Behavior of using None enum is
          the same as not using the documentType parameter.
        enum:
          - None
          - ClinicalTrial
          - DischargeSummary
          - ProgressNote
          - HistoryAndPhysical
          - Consult
          - Imaging
          - Pathology
          - ProcedureNote
      stringIndexType:
        $ref: common.json#/definitions/StringIndexType
    allOf:
      - $ref: common.json#/definitions/PreBuiltTaskParameters
  CustomHealthcareTaskParameters:
    type: object
    description: Supported parameters for a custom Healthcare task.
    properties:
      stringIndexType:
        $ref: common.json#/definitions/StringIndexType
    allOf:
      - $ref: common.json#/definitions/CustomTaskParameters
  HealthcareLROTask:
    type: object
    properties:
      parameters:
        $ref: '#/definitions/HealthcareTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextLROTask'
    x-ms-discriminator-value: Healthcare
  CustomHealthcareLROTask:
    type: object
    properties:
      parameters:
        $ref: '#/definitions/CustomHealthcareTaskParameters'
    allOf:
      - $ref: '#/definitions/AnalyzeTextLROTask'
    x-ms-discriminator-value: CustomHealthcare
  HealthcareResult:
    type: object
    properties:
      documents:
        type: array
        items:
          $ref: >-
            #/definitions/HealthcareEntitiesDocumentResultWithDocumentDetectedLanguage
    allOf:
      - $ref: common.json#/definitions/PreBuiltResult
    required:
      - documents
  CustomHealthcareResult:
    type: object
    properties:
      documents:
        type: array
        items:
          $ref: >-
            #/definitions/CustomHealthcareEntitiesDocumentResultWithDocumentDetectedLanguage
    allOf:
      - $ref: common.json#/definitions/CustomResult
    required:
      - documents
  HealthcareEntitiesDocumentResultWithDocumentDetectedLanguage:
    type: object
    allOf:
      - $ref: '#/definitions/HealthcareEntitiesDocumentResult'
      - $ref: '#/definitions/DocumentDetectedLanguage'
  CustomHealthcareEntitiesDocumentResultWithDocumentDetectedLanguage:
    type: object
    allOf:
      - $ref: '#/definitions/CustomHealthcareEntitiesDocumentResult'
      - $ref: '#/definitions/DocumentDetectedLanguage'
  HealthcareEntitiesDocumentResult:
    type: object
    properties:
      entities:
        description: Healthcare entities.
        type: array
        items:
          $ref: '#/definitions/HealthcareEntity'
      relations:
        type: array
        description: Healthcare entity relations.
        items:
          $ref: '#/definitions/HealthcareRelation'
      fhirBundle:
        type: object
        description: >-
          JSON bundle containing a FHIR compatible object for consumption in
          other Healthcare tools. For additional information see
          https://www.hl7.org/fhir/overview.html.
        additionalProperties: {}
    allOf:
      - $ref: '#/definitions/DocumentResult'
    required:
      - entities
      - relations
  CustomHealthcareEntitiesDocumentResult:
    type: object
    properties:
      entities:
        description: Healthcare entities.
        type: array
        items:
          $ref: '#/definitions/CustomHealthcareEntity'
      relations:
        type: array
        description: Healthcare entity relations.
        items:
          $ref: '#/definitions/HealthcareRelation'
    allOf:
      - $ref: '#/definitions/DocumentResult'
    required:
      - entities
      - relations
  HealthcareEntity:
    type: object
    properties:
      text:
        type: string
        description: Entity text as appears in the request.
      category:
        x-ms-enum:
          name: healthcareEntityCategory
          modelAsString: true
        type: string
        description: Healthcare Entity Category.
        enum:
          - BodyStructure
          - Age
          - Gender
          - Ethnicity
          - ExaminationName
          - Date
          - Direction
          - Frequency
          - MeasurementValue
          - MeasurementUnit
          - RelationalOperator
          - Time
          - Course
          - GeneOrProtein
          - Variant
          - Expression
          - MutationType
          - AdministrativeEvent
          - CareEnvironment
          - HealthcareProfession
          - Diagnosis
          - SymptomOrSign
          - ConditionQualifier
          - ConditionScale
          - MedicationClass
          - MedicationName
          - Dosage
          - MedicationForm
          - MedicationRoute
          - FamilyRelation
          - TreatmentName
          - Allergen
          - Employment
          - LivingStatus
          - SubstanceUse
          - SubstanceUseAmount
      subcategory:
        type: string
        description: (Optional) Entity sub type.
      offset:
        type: integer
        format: int32
        description: >-
          Start position for the entity text. Use of different 'stringIndexType'
          values can affect the offset returned.
      length:
        type: integer
        format: int32
        description: >-
          Length for the entity text. Use of different 'stringIndexType' values
          can affect the length returned.
      confidenceScore:
        type: number
        format: double
        description: Confidence score between 0 and 1 of the extracted entity.
      assertion:
        type: object
        $ref: '#/definitions/HealthcareAssertion'
      name:
        description: >-
          Preferred name for the entity. Example: 'histologically' would have a
          'name' of 'histologic'.
        type: string
      links:
        description: Entity references in known data sources.
        type: array
        items:
          $ref: '#/definitions/HealthcareEntityLink'
    required:
      - text
      - category
      - offset
      - length
      - confidenceScore
  CustomHealthcareEntity:
    type: object
    properties:
      entityComponentInformation:
        description: >-
          (Optional) Entity component information listing fired components of
          the extracted entity. This object only applies for custom healthcare.
        type: array
        items:
          $ref: '#/definitions/EntityComponentInformation'
    allOf:
      - $ref: '#/definitions/HealthcareEntity'
  HealthcareRelation:
    type: object
    description: >-
      Every relation is an entity graph of a certain relationType, where all
      entities are connected and have specific roles within the relation
      context.
    required:
      - relationType
      - entities
    properties:
      relationType:
        description: >-
          Type of relation. Examples include: `DosageOfMedication` or
          'FrequencyOfMedication', etc.
        type: string
        enum:
          - Abbreviation
          - BodySiteOfCondition
          - BodySiteOfTreatment
          - CourseOfCondition
          - CourseOfExamination
          - CourseOfMedication
          - CourseOfTreatment
          - DirectionOfBodyStructure
          - DirectionOfCondition
          - DirectionOfExamination
          - DirectionOfTreatment
          - DosageOfMedication
          - ExaminationFindsCondition
          - ExpressionOfGene
          - ExpressionOfVariant
          - FormOfMedication
          - FrequencyOfCondition
          - FrequencyOfMedication
          - FrequencyOfTreatment
          - MutationTypeOfGene
          - MutationTypeOfVariant
          - QualifierOfCondition
          - RelationOfExamination
          - RouteOfMedication
          - ScaleOfCondition
          - TimeOfCondition
          - TimeOfEvent
          - TimeOfExamination
          - TimeOfMedication
          - TimeOfTreatment
          - UnitOfCondition
          - UnitOfExamination
          - ValueOfCondition
          - ValueOfExamination
          - VariantOfGene
        x-ms-enum:
          name: relationType
          modelAsString: true
      confidenceScore:
        type: number
        format: double
        description: Confidence score between 0 and 1 of the extracted relation.
      entities:
        description: The entities in the relation.
        type: array
        items:
          $ref: '#/definitions/HealthcareRelationEntity'
  HealthcareAssertion:
    type: object
    properties:
      conditionality:
        description: Describes any conditionality on the entity.
        type: string
        enum:
          - hypothetical
          - conditional
        x-ms-enum:
          name: Conditionality
          modelAsString: false
      certainty:
        description: Describes the entities certainty and polarity.
        type: string
        enum:
          - positive
          - positivePossible
          - neutralPossible
          - negativePossible
          - negative
        x-ms-enum:
          name: Certainty
          modelAsString: false
      association:
        description: >-
          Describes if the entity is the subject of the text or if it describes
          someone else.
        type: string
        enum:
          - subject
          - other
        x-ms-enum:
          name: Association
          modelAsString: false
      temporality:
        description: Describes temporal information regarding the entity.
        type: string
        enum:
          - current
          - past
          - future
        x-ms-enum:
          name: Temporality
          modelAsString: false
  HealthcareRelationEntity:
    type: object
    required:
      - ref
      - role
    properties:
      ref:
        description: >-
          Reference link object, using a JSON pointer RFC 6901 (URI Fragment
          Identifier Representation), pointing to the entity .
        type: string
      role:
        description: >-
          Role of entity in the relationship. For example: 'CD20-positive
          diffuse large B-cell lymphoma' has the following entities with their
          roles in parenthesis:  CD20 (GeneOrProtein), Positive (Expression),
          diffuse large B-cell lymphoma (Diagnosis).
        type: string
  HealthcareEntityLink:
    type: object
    required:
      - dataSource
      - id
    properties:
      dataSource:
        description: 'Entity Catalog. Examples include: UMLS, CHV, MSH, etc.'
        type: string
      id:
        description: Entity id in the given source catalog.
        type: string
  EntityComponentInformation:
    description: >-
      This object contains information of the detected entity components. The
      possible component types may expand in the future. Parsing code should
      handle unexpected values gracefully
    type: object
    discriminator: entityComponentKind
    properties:
      entityComponentKind:
        description: The component object kind.
        type: string
        enum:
          - PrebuiltComponent
          - LearnedComponent
          - ListComponent
        x-ms-enum:
          name: entityComponentKind
          modelAsString: true
    required:
      - entityComponentKind
  PrebuiltComponent:
    description: >-
      This object contains information of the prebuilt component of 

# --- truncated at 32 KB (109 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/microsoft-azure/refs/heads/main/openapi/microsoft-cognitive-language-service-text-analysis-openapi-original.yml