Skip to content

Commit ae67531

Browse files
authored
Merge pull request #268458 from MicrosoftDocs/main
3/7/2024 PM Publish
2 parents e831bd0 + 1cd2d35 commit ae67531

File tree

200 files changed

+2820
-1388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+2820
-1388
lines changed

articles/ai-services/.openpublishing.redirection.ai-services-from-applied.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,13 @@
635635
"source_path_from_root": "/articles/ai-services/translator/document-translation/quickstarts/document-translation-rest-api.md",
636636
"redirect_url": "/azure/ai-services/translator/document-translation/quickstarts/asynchronous-rest-api",
637637
"redirect_document_id": true
638+
},
639+
{
640+
"source_path_from_root": "/articles/ai-services/document-intelligence/concept-retrieval-augumented-generation.md",
641+
"redirect_url": "/azure/ai-services/document-intelligence/concept-retrieval-augmented-generation",
642+
"redirect_document_id": true
638643
}
639644

645+
640646
]
641647
}

articles/ai-services/document-intelligence/choose-model-feature.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Choose the best Document Intelligence (formerly Form Recognizer) model for your applications and workflows
2+
title: Choose the best Document Intelligence (formerly Form Recognizer) model for your applications and workflows.
33
titleSuffix: Azure AI services
4-
description: Choose the best Document Intelligence model to meet your needs.
4+
description: Choose the best Document Intelligence model for your applications and workflows.
55
author: laujan
66
manager: nitinme
77
ms.service: azure-ai-document-intelligence
88
ms.custom:
99
- ignite-2023
1010
ms.topic: overview
11-
ms.date: 01/19/2024
11+
ms.date: 02/29/2024
1212
ms.author: lajanuar
1313
---
1414

@@ -54,12 +54,18 @@ The following decision charts highlight the features of each **Document Intellig
5454
|**US Tax 1098 form**|You want to extract mortgage interest details such as principal, points, and tax.|[**US tax 1098 model**](concept-tax-document.md)|
5555
|**US Tax 1098-E form**|You want to extract student loan interest details such as lender and interest amount.|[**US tax 1098-E model**](concept-tax-document.md)|
5656
|**US Tax 1098T form**|You want to extract qualified tuition details such as scholarship adjustments, student status, and lender information.|[**US tax 1098-T model**](concept-tax-document.md)|
57-
|**US Tax 1099(Variations) form**|You want to extract information from 1099 forms and its variations (A, B, C, CAP, DIV, G, H, INT, K, LS, LTC, MISC, NEC, OID, PATR, Q, QA, R, S, SA, SB).|[**US tax 1099 model**](concept-tax-document.md)|
57+
|**US Tax 1099(Variations) form**|You want to extract information from `1099` forms and its variations (A, B, C, CAP, DIV, G, H, INT, K, LS, LTC, MISC, NEC, OID, PATR, Q, QA, R, S, SA, SB).|[**US tax 1099 model**](concept-tax-document.md)|
58+
|**US Tax 1040(Variations) form**|You want to extract information from `1040` forms and its variations (Schedule 1, Schedule 2, Schedule 3, Schedule 8812, Schedule A, Schedule B, Schedule C, Schedule D, Schedule E, Schedule EIC, Schedule F, Schedule H, Schedule J, Schedule R, Schedule SE, Schedule Senior).|[**US tax 1040 model**](concept-tax-document.md)|
5859
|**Contract** (legal agreement between parties).|You want to extract contract agreement details such as parties, dates, and intervals.|[**Contract model**](concept-contract.md)|
5960
|**Health insurance card** or health insurance ID.| You want to extract key information such as insurer, member ID, prescription coverage, and group number.|[**Health insurance card model**](./concept-health-insurance-card.md)|
61+
|**Credit/Debit card** . |You want to extract key information bank cards such as card number and bank name. | [**Credit/Debit card model**](concept-credit-card.md)|
62+
|**Marriage Certificate** . |You want to extract key information from marriage certificates. | [**Marriage certificate model**](concept-marriage-certificate.md)|
6063
|**Invoice** or billing statement.|You want to extract key information such as customer name, billing address, and amount due.|[**Invoice model**](concept-invoice.md)
61-
|**Receipt**, voucher, or single-page hotel receipt. |You want to extract key information such as merchant name, transaction date, and transaction total.|[**Receipt model**](concept-receipt.md)|
62-
|**Identity document (ID)** like a U.S. driver's license or international passport. |You want to extract key information such as first name, last name, date of birth, address, and signature. | [**Identity document (ID) model**](concept-id-document.md)|
64+
|**Receipt**, voucher, or single-page hotel receipt. |You want to extract key information such as merchant name, transaction date, and transaction total.|[**Receipt model**](concept-receipt.md)|
65+
|**Identity document (ID)** like a U.S. driver's license or international passport. |You want to extract key information such as first name, surname, date of birth, address, and signature. | [**Identity document (ID) model**](concept-id-document.md)|
66+
|**US Mortgage 1003** . |You want to extract key information from the Uniform Residential loan application. | [**1003 form model**](concept-mortgage-documents.md)|
67+
|**US Mortgage 1008** . |You want to extract key information from the Uniform Underwriting and Transmittal summary. | [**1008 form model**](concept-mortgage-documents.md)|
68+
|**US Mortgage Closing Disclosure** . |You want to extract key information from a mortgage closing disclosure form. | [**Mortgage closing disclosure form model**](concept-mortgage-documents.md)|
6369
|**Mixed-type document(s)** with structured, semi-structured, and/or unstructured elements. | You want to extract key-value pairs, selection marks, tables, signature fields, and selected regions not extracted by prebuilt or general document models.| [**Custom model**](concept-custom.md)|
6470

6571
>[!Tip]

articles/ai-services/document-intelligence/concept-accuracy-confidence.md

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ ms.service: azure-ai-document-intelligence
88
ms.custom:
99
- ignite-2023
1010
ms.topic: conceptual
11-
ms.date: 11/15/2023
11+
ms.date: 02/29/2024
1212
ms.author: lajanuar
1313
---
1414

15-
16-
17-
1815
# Custom models: accuracy and confidence scores
1916

2017
[!INCLUDE [applies to v4.0, v3.1, v3.0, and v2.1](includes/applies-to-v40-v31-v30-v21.md)]
@@ -24,6 +21,7 @@ ms.author: lajanuar
2421
> * **Custom neural models do not provide accuracy scores during training**.
2522
> * Confidence scores for structured fields such as tables are currently unavailable.
2623
24+
2725
Custom models generate an estimated accuracy score when trained. Documents analyzed with a custom model produce a confidence score for extracted fields. In this article, learn to interpret accuracy and confidence scores and best practices for using those scores to improve accuracy and confidence results.
2826

2927
## Accuracy scores
@@ -38,9 +36,14 @@ The accuracy value range is a percentage between 0% (low) and 100% (high). The e
3836

3937
## Confidence scores
4038

39+
> [!NOTE]
40+
>
41+
> * **Table cell confidence scores are now included with the 2024-02-29-preview API version**.
42+
> * Confidence scores for table cells from custom models is added to the API starting with the 2024-02-29-preview API.
43+
4144
Document Intelligence analysis results return an estimated confidence for predicted words, key-value pairs, selection marks, regions, and signatures. Currently, not all document fields return a confidence score.
4245

43-
Field confidence indicates an estimated probability between 0 and 1 that the prediction is correct. For example, a confidence value of 0.95 (95%) indicates that the prediction is likely correct 19 out of 20 times. For scenarios where accuracy is critical, confidence can be used to determine whether to automatically accept the prediction or flag it for human review.
46+
Field confidence indicates an estimated probability between 0 and 1 that the prediction is correct. For example, a confidence value of 0.95 (95%) indicates that the prediction is likely correct 19 out of 20 times. For scenarios where accuracy is critical, confidence can be used to determine whether to automatically accept the prediction or flag it for human review.
4447

4548
Confidence scores have two data points: the field level confidence score and the text extraction confidence score. In addition to the field confidence of position and span, the text extraction confidence in the ```pages``` section of the response is the model's confidence in the text extraction (OCR) process. The two confidence scores should be combined to generate one overall confidence score.
4649

@@ -55,26 +58,61 @@ The following table demonstrates how to interpret both the accuracy and confiden
5558

5659
| Accuracy | Confidence | Result |
5760
|--|--|--|
58-
| High| High | <ul><li>The model is performing well with the labeled keys and document formats. </li><li>You have a balanced training dataset</li></ul> |
59-
| High | Low | <ul><li>The analyzed document appears different from the training dataset.</li><li>The model would benefit from retraining with at least five more labeled documents. </li><li>These results could also indicate a format variation between the training dataset and the analyzed document. </br>Consider adding a new model.</li></ul> |
60-
| Low | High | <ul><li>This result is most unlikely.</li><li>For low accuracy scores, add more labeled data or split visually distinct documents into multiple models.</li></ul> |
61-
| Low | Low| <ul><li>Add more labeled data.</li><li>Split visually distinct documents into multiple models.</li></ul>|
61+
| High| High | &bullet; The model is performing well with the labeled keys and document formats. <br>&bullet; You have a balanced training dataset. |
62+
| High | Low | &bullet; The analyzed document appears different from the training dataset.<br>&bullet; The model would benefit from retraining with at least five more labeled documents. <br>&bullet; These results could also indicate a format variation between the training dataset and the analyzed document. </br>Consider adding a new model.|
63+
| Low | High | &bullet; This result is most unlikely.<br>&bullet; For low accuracy scores, add more labeled data or split visually distinct documents into multiple models. |
64+
| Low | Low| &bullet; Add more labeled data.<br>&bullet; Split visually distinct documents into multiple models.|
65+
66+
## Table, row, and cell confidence
67+
68+
With the addition of table, row and cell confidence with the ```2024-02-29-preview``` API, here are some common questions that should help with interpreting the scores:
69+
70+
**Q:** Is it possible to see a high confidence score for cells, but a low confidence score for the row?<br>
71+
72+
**A:** Yes. The different levels of table confidence (cell, row, and table) are meant to capture the correctness of a prediction at that specific level. A correctly predicted cell that belongs to a row with other possible misses would have high cell confidence, but the row's confidence should be low. Similarly, a correct row in a table with challenges with other rows would have high row confidence whereas the table's overall confidence would be low.
73+
74+
**Q:** What is the expected confidence score when cells are merged? Since a merge results in the number of columns identified to change, how are scores affected?<br>
75+
76+
**A:** Regardless of the type of table, the expectation for merged cells is that they should have lower confidence values. Furthermore, the cell that is missing (because it was merged with an adjacent cell) should have `NULL` value with lower confidence as well. How much lower these values might be depends on the training dataset, the general trend of both merged and missing cell having lower scores should hold.
77+
78+
**Q:** What is the confidence score when a value is optional? Should you expect a cell with a ``NULL`` value and high confidence score if the value is missing?<br>
79+
80+
**A:** If your training dataset is representative of the optionality of cells, it helps the model know how often a value tends to appear in the training set, and thus what to expect during inference. This feature is used when computing the confidence of either a prediction or of making no prediction at all (`NULL`). You should expect an empty field with high confidence for missing values that are mostly empty in the training set too.
81+
82+
**Q:** How are confidence scores affected if a field is optional and not present or missed? Is the expectation that the confidence score answers that question?<br>
83+
84+
**A:** When a value is missing from a row, the cell has a `NULL` value and confidence assigned. A high confidence score here should mean that the model prediction (of there not being a value) is more likely to be correct. In contrast, a low score should signal more uncertainty from the model (and thus the possibility of an error, like the value being missed).
85+
86+
**Q:** What should be the expectation for cell confidence and row confidence when extracting a multi-page table with a row split across pages?<br>
87+
88+
**A:** Expect the cell confidence to be high and row confidence to be potentially lower than rows that aren't split. The proportion of split rows in the training data set can affect the confidence score. In general, a split row looks different than the other rows in the table (thus, the model is less certain that it's correct).
89+
90+
**Q:** For cross-page tables with rows that cleanly end and start at the page boundaries, is it correct to assume that confidence scores are consistent across pages?
91+
92+
**A:** Yes. Since rows look similar in shape and contents, regardless of where they are in the document (or in which page), their respective confidence scores should be consistent.
93+
94+
**Q:** What is the best way to utilize the new confidence scores?<br>
95+
96+
**A:** Look at all levels of table confidence starting in a top-to-bottom approach: begin by checking a table's confidence as a whole, then drill down to the row level and look at individual rows, finally look at cell-level confidences. Depending on the type of table, there are a couple of things of note:
97+
98+
For **fixed tables**, cell-level confidence already captures quite a bit of information on the correctness of things. This means that simply going over each cell and looking at its confidence can be enough to help determine the quality of the prediction.
99+
For **dynamic tables**, the levels are meant to build on top of each other, so the top-to-bottom approach is more important.
62100

63101
## Ensure high model accuracy
64102

65103
Variances in the visual structure of your documents affect the accuracy of your model. Reported accuracy scores can be inconsistent when the analyzed documents differ from documents used in training. Keep in mind that a document set can look similar when viewed by humans but appear dissimilar to an AI model. To follow, is a list of the best practices for training models with the highest accuracy. Following these guidelines should produce a model with higher accuracy and confidence scores during analysis and reduce the number of documents flagged for human review.
66104

67105
* Ensure that all variations of a document are included in the training dataset. Variations include different formats, for example, digital versus scanned PDFs.
68106

69-
* If you expect the model to analyze both types of PDF documents, add at least five samples of each type to the training dataset.
107+
* Add at least five samples of each type to the training dataset if you expect the model to analyze both types of PDF documents.
70108

71109
* Separate visually distinct document types to train different models.
72110
* As a general rule, if you remove all user entered values and the documents look similar, you need to add more training data to the existing model.
73111
* If the documents are dissimilar, split your training data into different folders and train a model for each variation. You can then [compose](how-to-guides/compose-custom-models.md?view=doc-intel-2.1.0&preserve-view=true#create-a-composed-model) the different variations into a single model.
74112

75-
* Make sure that you don't have any extraneous labels.
113+
* Ensure that you don't have any extraneous labels.
76114

77-
* For signature and region labeling, don't include the surrounding text.
115+
* Ensure that signature and region labeling doesn't include the surrounding text.
78116

79117
## Next step
80118

0 commit comments

Comments
 (0)