> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Evaluate Document Conciseness

> Calculates how much of the information in the candidate document is contained in the reference document.
Each sentence of the candidate document that the reference document does not support decreases the score.

The API splits each section of the candidate document into sentences.
Each sentence becomes one claim.
A language model compares each claim with the reference document and gives a verdict.
Each claim contains the evidence from the reference document. A `not_applicable` claim contains no evidence.

This operation uses a language model. It uses credits.




## OpenAPI

````yaml /api-reference/auto-generated-openapi.yml post /tools/evaluations/text/documents/conciseness
openapi: 3.0.0
info:
  title: Corti API
  version: 2.0.0
servers:
  - url: https://api.{environment}.corti.app/v2/
    variables:
      environment:
        default: eu
        enum:
          - us
          - eu
security:
  - AuthorizationHeader:
      - bearer
tags:
  - name: Interactions
  - name: Recordings
  - name: Transcripts
  - name: Facts
  - name: Codes
  - name: FHIR
  - name: Languages
  - name: Guided Documents
  - name: Guided Templates
  - name: Guided Sections
  - name: Documents (Classic)
  - name: Templates (Classic)
  - name: Evaluations
paths:
  /tools/evaluations/text/documents/conciseness:
    post:
      tags:
        - Evaluations
      summary: Evaluate Document Conciseness
      description: >
        Calculates how much of the information in the candidate document is
        contained in the reference document.

        Each sentence of the candidate document that the reference document does
        not support decreases the score.


        The API splits each section of the candidate document into sentences.

        Each sentence becomes one claim.

        A language model compares each claim with the reference document and
        gives a verdict.

        Each claim contains the evidence from the reference document. A
        `not_applicable` claim contains no evidence.


        This operation uses a language model. It uses credits.
      operationId: evaluations_documents_conciseness
      parameters:
        - $ref: '#/components/parameters/Tenant-Name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationConcisenessRequest'
      responses:
        '200':
          description: >-
            The scores and a list of claims, each claim corresponding to one
            sentence from the candidate document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationConcisenessResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/EvaluationForbidden'
        '429':
          $ref: '#/components/responses/EvaluationTooManyRequests'
        '500':
          $ref: '#/components/responses/EvaluationInternalError'
        '502':
          $ref: '#/components/responses/EvaluationBadGateway'
components:
  parameters:
    Tenant-Name:
      name: Tenant-Name
      in: header
      description: >-
        Identifies a distinct entity within Corti's multi-tenant system. Ensures
        correct routing and authentication of the request.
      required: true
      example: base
      schema:
        type: string
        description: >-
          Identifies a distinct entity within Corti's multi-tenant system.
          Ensures correct routing and authentication of the request.
        example: base
  schemas:
    EvaluationConcisenessRequest:
      type: object
      required:
        - language
        - candidateDocument
        - referenceDocument
      properties:
        language:
          $ref: '#/components/schemas/EvaluationLanguage'
        candidateDocument:
          $ref: '#/components/schemas/EvaluationDocument'
        referenceDocument:
          $ref: '#/components/schemas/EvaluationDocument'
    EvaluationConcisenessResponse:
      allOf:
        - $ref: '#/components/schemas/EvaluationScores'
        - type: object
          required:
            - claims
          properties:
            claims:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/EvaluationClaim'
                  - type: object
                    required:
                      - candidateDocumentSpan
                      - referenceDocumentEvidence
                    properties:
                      candidateDocumentSpan:
                        $ref: '#/components/schemas/EvaluationDocumentSpan'
                      referenceDocumentEvidence:
                        type: array
                        items:
                          $ref: '#/components/schemas/EvaluationDocumentSpan'
    EvaluationLanguage:
      type: string
      description: |
        The language of the documents, as a BCP-47 language tag.
        For example `en` or `en-US`.
      example: en
    EvaluationDocument:
      type: object
      description: >
        A document. Each key is a section ID. Each value is the text of that
        section.

        Section IDs must not be empty.


        The API processes the sections in the order of the request.

        The spans and claims in the response are in the order of the sections in
        the request, and then in the order in the text.
      minProperties: 1
      additionalProperties:
        type: string
      example:
        subjective: Patient reports right knee pain for two weeks.
        plan: Follow-up in one week.
    EvaluationScores:
      type: object
      required:
        - score
        - strictScore
        - looseScore
        - evaluationConfigHash
        - usageInfo
      properties:
        score:
          type: number
          format: double
          minimum: 0
          maximum: 1
          description: >
            The mean value of the verdicts. A `grounded` verdict is 1, a
            `partial` verdict is 0.5 and an `ungrounded` verdict is 0.

            When all claims are `not_applicable`, the score is 1.
        strictScore:
          type: number
          format: double
          minimum: 0
          maximum: 1
          description: The same as `score`, but a `partial` verdict is 0.
        looseScore:
          type: number
          format: double
          minimum: 0
          maximum: 1
          description: The same as `score`, but a `partial` verdict is 1.
        evaluationConfigHash:
          type: string
          description: >
            A SHA-256 hash of the evaluation configuration: the language model,
            the prompt and the parameters of the language model.

            The hash does not include the content of the request.

            Compare scores only when they have the same hash.
          example: >-
            sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
        usageInfo:
          $ref: '#/components/schemas/CommonUsageInfo'
    EvaluationClaim:
      type: object
      required:
        - verdict
      properties:
        verdict:
          $ref: '#/components/schemas/EvaluationVerdict'
        reason:
          type: string
          description: The language model's reasoning for the verdict.
    EvaluationDocumentSpan:
      type: object
      description: >
        A sentence in a section of a document.

        `start` and `end` are character offsets in the text of the section. The
        API counts Unicode code points.

        `start` is inclusive. `end` is exclusive.
      required:
        - start
        - end
        - text
        - sectionId
      properties:
        start:
          type: integer
          minimum: 0
          description: The offset of the first character of the sentence.
        end:
          type: integer
          minimum: 0
          description: The offset after the last character of the sentence.
        text:
          type: string
          minLength: 1
          description: >-
            The text of the sentence. The text has no whitespace at the start or
            at the end.
        sectionId:
          type: string
          minLength: 1
          description: The section ID in the document.
    ErrorResponse:
      type: object
      required:
        - requestid
        - status
        - type
        - detail
      properties:
        requestid:
          type: string
        status:
          type: integer
        type:
          type: string
        detail:
          type: string
        validationErrors:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
    CommonUsageInfo:
      type: object
      description: Credits consumed for this request.
      required:
        - creditsConsumed
      properties:
        creditsConsumed:
          type: number
    EvaluationVerdict:
      type: string
      description: >
        The verdict given by the language model for a claim.

        - `grounded`: The evidence supports the claim.

        - `partial`: The evidence supports a part of the claim.

        - `ungrounded`: The evidence does not support the claim.

        - `not_applicable`: The claim is a section heading or text that has no
        clinical content. The scores do not include this claim.
      enum:
        - grounded
        - partial
        - ungrounded
        - not_applicable
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    EvaluationForbidden:
      description: The access token does not have the scope for evaluations.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    EvaluationTooManyRequests:
      description: >-
        The API has too many evaluation requests. Wait. Then send the request
        again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    EvaluationInternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    EvaluationBadGateway:
      description: The API could not complete the evaluation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    AuthorizationHeader:
      type: http
      description: Input your token
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.