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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.affinda.com/feedback

```json
{
  "path": "/configuration/confidence",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Confidence

> Understand how Affinda calculates field-level and document-level confidence scores, and how to use them to drive automation and validation rules.

Affinda provides confidence scores for data extracted to help you assess the reliability of data extracted from your documents. Rather than using a confidence value from the model that does not strongly reference the data from the documents validated by users, our approach to confidence is to provide significantly higher weight to validated documents of a similar format to the uploaded document.

Confidence Scores, when available, are shown in the Affinda app when you hover over the yellow dot next to an unconfirmed field:

<img className="block dark:hidden border-2 border-gray-300 rounded-lg" src="https://mintcdn.com/affinda-44/X0_dfJGu-kAY4WOy/images/confidencelight.png?fit=max&auto=format&n=X0_dfJGu-kAY4WOy&q=85&s=7175e3ea2abd13e7c2e3cbf54e630552" alt="Confidence Score Example" style={{ width:"60%" }} width="757" height="72" data-path="images/confidencelight.png" />

<img className="hidden dark:block border-2 border-gray-300 rounded-lg" src="https://mintcdn.com/affinda-44/X0_dfJGu-kAY4WOy/images/confidencedark.png?fit=max&auto=format&n=X0_dfJGu-kAY4WOy&q=85&s=01d739f5d99e19f4e5d103a7db16df96" alt="Confidence Score Example" style={{ width:"60%" }} width="754" height="67" data-path="images/confidencedark.png" />

## Benefits

* Confidence is not calculated without the context of other validated documents. Instead, it pays particular attention to the data from very relevant documents
* The ceiling for how confident the model can be in the predictions is much higher (up to 99%)

## Limitations

* While our method of calculating confidence delivers strong results when using Affinda's platform at scale, it will take 2-3 examples of the same document format before confidence will be returned on fields

## How Confidence is Calculated

<Steps>
  <Step title="Fingerprint Matching">
    When users upload a document, our Fingerprinting algorithm identifies suitable reference document(s) from [Model Memory](/configuration/model-memory) that are provided to the model to help guide the extraction.
  </Step>

  <Step title="User Validation">
    Whenever someone validates data from a processed document, we store the data results as our "ground truth" for confidence calculation. Accuracy is measured by comparing the model's predictions with validated annotations.
  </Step>

  <Step title="Confidence Determination">
    For each new document, we look at the accuracy results from up to the last five validated documents that used the same reference document. An overall accuracy score is calculated for each extracted field.
  </Step>
</Steps>

## Setting Confidence Thresholds

Affinda can support both field-level and global confidence thresholds.

**Field-level:** Users can configure a specific confidence threshold by creating a validation rule in the app. For example, "@Date of Establishment confidence is >80%" 

**Global:** Affinda can support **global confidence thresholds** to enable auto-validation of:

* **Fields** that meet the global threshold.
* **Documents** that meet the global threshold.

Global thresholds are **not currently supported** through validation rules. To enable for your workspace, please [reach out to the Affinda team. ](https://www.affinda.com/contact)

### FAQs

<AccordionGroup>
  <Accordion title="What if there's no previous validation for my reference document?">
    If there are no prior validated data for that document format, we provide annotations without a confidence score.
  </Accordion>

  <Accordion title="How many validations are required to see confidence scores?">
    Only one validated document per reference is required to begin showing confidence scores.
  </Accordion>
</AccordionGroup>
