# Validating predicted values

> Validate IXP model predictions in the Extract node of UiPath Maestro™ Flow to establish ground truth after refining prompt instructions, without directly training the model from annotations.

## Overview

The model does not learn directly from user annotations. To improve the performance of the model, modify your prompt instructions or model configuration.

After you finish refining the instructions, validate the predictions of the model to establish the ground truth for its performance evaluation. Predictions and references play different roles in validation. For details, check [Predictions and references](#predictions-and-references).

The validation process entails the following:

* Confirming the extracted values if they are correct.
* Annotating the expected values if the predicted values are incorrect.
* Marking fields as missing if they are not present in the document.
* Configuring any additional fields in your taxonomy.

## Predictions and references

**Predictions** are the predicted values compared to ground truth.

:::note
Incorrect or missing predictions impact the model score and performance metrics in the **Eval runs** tab.
:::

**References** are the matching references to the predicted values found in the document. The purpose of references is to help users find the right part of the document.

:::note
Incorrect or missing references do not impact the model score or performance metrics. However, it might be helpful to add or correct references to improve the human validation experience.
:::

There are known limitations with references and highlighted spans:

* The prediction and reference are correct, but an incorrect span is highlighted. Usually, it is the first match that was found.
* The prediction is correct, but there is a missing reference and a highlighted span. In these scenarios, a page number is provided as a fallback.

![The selected Vendor name value in the annotation panel, which is the prediction, and its highlighted span in the document, which is the reference.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-prediction-and-reference-c86ce345.webp)

## Confirmed and unconfirmed references and values

This section shows what values and references look like in their confirmed state (validated) and unconfirmed state (not validated).

### Predicted values

The following image shows the annotation panel listing the values that the model predicted for each field:

![The annotation panel with the predicted values of the Invoice details field group, none of them confirmed.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-predicted-values-cb17a7ec.webp)

### Unconfirmed values

The following image shows the annotation panel with unconfirmed values, where none of the checkboxes are selected:

![The annotation panel with the cleared checkboxes of unconfirmed values highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-unconfirmed-extractions-fca13b1c.webp)

### Confirmed values

The following image shows the references of confirmed values in the document, each highlighted with a solid border:

![Highlighted references of confirmed values in the document, each with a solid border.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-confirmed-reference-67119fdc.webp)

The following image shows the annotation panel with confirmed values, where the checkboxes are selected:

![The annotation panel with the selected checkboxes of confirmed values highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-confirmed-extractions-372e556f.webp)

## Validated values

This section contains example scenarios of when the model predictions match or do not match the user's annotations.

When the annotation matches the prediction, which means that the prediction is correct, the value looks as in the following image:

![A confirmed value that matches the prediction.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-correct-prediction-8c7eee14.webp)

When the annotation does not match the prediction, which means that the prediction is incorrect, the value looks as in the following image:

![A corrected value with the original prediction shown below it and in the Predicted tooltip.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-incorrect-prediction-254c0be9.webp)

:::note
Predictions are compared to annotations, not the references. References might be missing or incorrect, but this is not flagged as a mismatch.
:::

## Validating predicted values

In the annotation view, each extracted value is highlighted in the document with the color of its field, as shown next to the field name in the annotation panel. Extracted values are highlighted as follows:

* **Filled**: Extracted values. The fill is the same for confirmed and unconfirmed values. To check whether a value is confirmed, use its checkbox in the annotation panel: the checkbox is selected for confirmed values and cleared for unconfirmed values.

  ![Filled highlights in the document, in the colors of their fields, with the cleared checkbox of an unconfirmed value highlighted in the annotation panel.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-highlight-filled-f26a6bc3.webp)

* **Solid border**: The selected value. When you select a value in the annotation panel, its highlight in the document gets a solid border.

  ![The highlight of a selected value, with a solid border around it.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-highlight-selected-dab94ec4.webp)

To validate the predicted values, follow these steps:

1.  Point to the Flow **Extract** node and select **Open full view**.
2.  In the **Dataset** tab, select **Annotate** for the document you want to validate. The model highlights the relevant span of text in the document and displays the generated predictions in the annotation panel. 
    
    Values that are applicable to multiple instances of a field group, such as account number, have arrow buttons to help navigate to relevant sections. The buttons appear when you point to the values.

    ![The Dataset tab of the Extract document node, with the Annotate icon of a document highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-dataset-tab-annotate-0484c5e8.webp)

3.  Review the predictions and confirm the extracted values in one of the following ways:

    * To confirm a single value, select its checkbox.
    * To confirm an entire field group row, select the row checkbox.

    :::note
    Any changes you make but do not submit are saved as a draft, which you can return to and update later. For more details, check [Draft annotations](#draft-annotations).
    :::

4. Select **Submit** to submit your annotations.

You can configure additional fields in your extraction schema at any point from the **Definition** tab.

### Example of validating predicted values in Action Center

The following image shows an example of validating predicted values in Action Center:

![Example of validating predicted values in Action Center.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-example-of-validating-extractions-from-action-center-588392-eaf75e6e.webp)

## Annotating the expected value

When a predicted value is incorrect, annotate the expected value. Your annotation becomes the ground truth, which is the correct value that evaluation runs compare the model predictions to. It does not change the model or its future predictions.

To annotate the expected value, proceed as follows:

1. In the annotation panel, select the ellipsis for the field and then **Change extracted value**. For a field without a value, showing **Is missing**, select the plus icon.
2. Highlight the correct value in the document.

   ![A word selected in the document and the Change extracted value option highlighted in the field menu.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-change-extracted-value-2ee9d469.webp)

3. Select **Submit** to submit your annotations.

## Editing values

In the annotation view of the Flow **Extract** node, you can edit values in the following ways:

* Select **Add value** to create a new value with no reference in the document.
* Select the ellipsis for a field to use one of the following options:
  * **Change extracted value**
  * **Revert to previous value**
  * **Mark as missing**
* Select the ellipsis for a field group row to use one of the following options:
  * **Highlight row**
  * **Delete row**

![The field group row menu with the Highlight row and Delete row options.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-field-group-row-menu-7398338a.webp)

To confirm the values, select the checkbox of each value or field group row.

To show each instance of a field group as a row in a table instead of a list in the annotation panel, proceed as follows:

1. In the **Definition** tab, select the ellipsis for the field group.
2. Turn on **Display as a table**.

## Draft annotations

Any edits you make to values and references on a document are stored as draft annotations until you submit them as annotations. As a result, the document status appears as **In progress** or as **Annotated (Editing)** for a document that was already annotated. To discard the draft, select **Discard draft**.

All of the previously mentioned actions, such as validating, annotating, and editing values, and submitting the annotations, are kept in the draft as you make changes.

If you refresh predictions while a document is in the draft state, the system preserves the draft annotations while repopulating new predictions and matches the new set of predictions from the model to the draft annotations.

## Stopping the validation

Validate at least 10 examples per field so that the model can provide meaningful validation statistics.
