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

# The BatchProcessorRun object

The BatchProcessorRun object is returned by the [Get Batch Processor Run](/api-reference/endpoint/get_batch_processor_run) endpoint.

The object represents a run of a processor over a batch of files and contains all the information about the run, including metrics, the processor that was run, and the status of the run.

<Expandable title="properties" defaultOpen>
  <ResponseField name="object" type="string">
    The type of response, will always be "batch\_processor\_run".
  </ResponseField>

  {" "}

  <ResponseField name="id" type="string">
    The unique identifier for this batch processor run.
  </ResponseField>

  {" "}

  <ResponseField name="processorId" type="string">
    The ID of the processor used for this run.
  </ResponseField>

  {" "}

  <ResponseField name="processorVersionId" type="string">
    The ID of the specific processor version used.
  </ResponseField>

  {" "}

  <ResponseField name="processorName" type="string">
    The name of the processor.
  </ResponseField>

  {" "}

  <ResponseField name="metrics" type="object">
    The metrics for the batch processor run.

    <Expandable title="properties">
      <ResponseField name="numFiles" type="number">
        The total number of files that were processed.
      </ResponseField>

      <ResponseField name="numPages" type="number">
        The total number of pages that were processed.
      </ResponseField>

      <ResponseField name="type" type="string">
        The type of batch processor run. Possible values are `EXTRACT`, `CLASSIFY`, and `SPLITTER`.

        The sections below show the fields in this object that are present for each type of run.
      </ResponseField>

      <Expandable title="EXTRACT">
        <ResponseField name="fieldMetrics" type="object">
          Record mapping field names to their respective metrics.

          <Expandable title="Field Metrics Structure">
            <ResponseField name="meanConfidence" type="number" optional>
              The mean confidence score for this field across all documents.
            </ResponseField>

            <ResponseField name="recallPerc" type="number" optional>
              The recall percentage for this field, representing how many of the expected values were correctly extracted.
            </ResponseField>

            <ResponseField name="precisionPerc" type="number" optional>
              The precision percentage for this field, representing how many of the extracted values were correct.
            </ResponseField>

            <ResponseField name="fieldMetrics" type="object" optional>
              For nested object fields, this contains metrics for the child fields. Has the same structure as the parent fieldMetrics.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="arrayCardinalityMetrics" type="object" optional>
          Maps the root array field name to a number indicating how many times the array field has the correct number of rows extracted.
        </ResponseField>
      </Expandable>

      <Expandable title="CLASSIFY">
        <ResponseField name="accuracyPerc" type="number" optional>
          The overall accuracy percentage.
        </ResponseField>

        <ResponseField name="meanConfidence" type="number" optional>
          The mean confidence score.
        </ResponseField>

        <ResponseField name="distribution" type="object">
          Record mapping classification values to their counts.
        </ResponseField>

        <ResponseField name="accuracyPercByClassification" type="object" optional>
          Mapping from classification to accuracy percentage as calculated from the confusion matrix.
        </ResponseField>

        <ResponseField name="confusionMatrix" type="object" optional>
          Mapping from actual class to predicted class to count. Only present when accuracy percentage is present.
        </ResponseField>
      </Expandable>

      <Expandable title="SPLITTER">
        <ResponseField name="precisionPerc" type="number" optional>
          Number of predicted subdocuments that are in the expected set of subdocuments divided by total number of predicted subdocuments.
        </ResponseField>

        <ResponseField name="recallPerc" type="number" optional>
          Number of expected subdocuments that are in the predicted set of subdocuments divided by total number of expected subdocuments.
        </ResponseField>

        <ResponseField name="numExpectedDocs" type="number" optional>
          The number of expected documents.
        </ResponseField>

        <ResponseField name="numPredictedDocs" type="number" optional>
          The number of predicted documents.
        </ResponseField>

        <ResponseField name="numCorrectDocs" type="number" optional>
          The number of correctly predicted documents.
        </ResponseField>
      </Expandable>

      <ResponseField name="meanRunTimeMs" type="number" optional>
        The mean runtime in milliseconds per document.
      </ResponseField>
    </Expandable>
  </ResponseField>

  {" "}

  <ResponseField name="status" type="string">
    The current status of the batch processor run. Possible values are `PENDING`,
    `PROCESSING`, `PROCESSED`, `FAILED`.
  </ResponseField>

  {" "}

  <ResponseField name="source" type="string">
    The source of the batch processor run.

    <Expandable title="possible values">
      <ResponseField name="EVAL_SET">
        The batch processor run was made from an evaluation set. In this case, the
        `sourceId` will be the ID of the evaluation set, such as `ev_1234`.
      </ResponseField>

      <ResponseField name="PLAYGROUND">
        The batch processor run was made from the playground. The `sourceId` will
        not be set for this value.
      </ResponseField>

      <ResponseField name="STUDIO">
        The batch processor run was made for a processor in Studio. The `sourceId` will be the
        ID of the processor, such as `dp_1234`.
      </ResponseField>
    </Expandable>
  </ResponseField>

  {" "}

  <ResponseField name="sourceId" type="string" optional>
    The ID of the source of the batch processor run. See the `source` field for
    more details.
  </ResponseField>

  {" "}

  <ResponseField name="runCount" type="number">
    The number of runs that were made.
  </ResponseField>

  {" "}

  <ResponseField name="options" type="object">
    The options for the batch processor run.

    <Expandable title="properties">
      <ResponseField name="fuzzyMatchFields" type="array">
        The fields that were fuzzy matched. Optional.
      </ResponseField>

      <ResponseField name="excludeFields" type="array">
        The fields that were excluded from the run. Optional.
      </ResponseField>

      <ResponseField name="clearPreProcessingCache" type="boolean">
        Whether the pre processing cache was cleared. Optional.
      </ResponseField>
    </Expandable>
  </ResponseField>

  {" "}

  <ResponseField name="createdAt" type="string">
    The date and time the batch processor run was created.
  </ResponseField>

  {" "}

  <ResponseField name="updatedAt" type="string">
    The date and time the batch processor run was last updated.
  </ResponseField>
</Expandable>

<ResponseExample>
  ```json Example Response theme={null}
  {
    "object": "batch_processor_run",
    "id": "bpr_1234",
    "processorId": "dp_5678",
    "processorVersionId": "dpv_91011",
    "processorName": "Invoice Extractor",
    "metrics": {
      "numFiles": 10,
      "numPages": 25,
      "meanRunTimeMs": 1500,
      "type": "EXTRACT",
      "fieldMetrics": {
        "invoice_number": {
          "meanConfidence": 0.95,
          "recallPerc": 98.5,
          "precisionPerc": 99.2
        },
        "invoice_date": {
          "meanConfidence": 0.92,
          "recallPerc": 95.1,
          "precisionPerc": 97.3
        }
      }
    },
    "status": "PROCESSED",
    "source": "STUDIO",
    "sourceId": "dp_5678",
    "runCount": 1,
    "options": {
      "fuzzyMatchFields": ["invoice_number"],
      "excludeFields": ["internal_notes"],
      "clearPreProcessingCache": false
    },
    "createdAt": "2023-05-15T10:30:45Z",
    "updatedAt": "2023-05-15T10:35:22Z"
  }
  ```
</ResponseExample>
