Skip to content

Commit cb24dcd

Browse files
Merge pull request #37 from Azure-Samples/chienyuanchang/document_pro_mode_sample
Add Pro mode sample
2 parents bf3c65e + 58f0ccd commit cb24dcd

22 files changed

+744
-64
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Azure AI Content Understanding is a new Generative AI-based [Azure AI service](h
136136
| --- | --- |
137137
| [content_extraction.ipynb](notebooks/content_extraction.ipynb) | In this sample we will show content understanding API can help you get semantic information from your file. For example OCR with table in document, audio transcription, and face analysis in video. |
138138
| [field_extraction.ipynb](notebooks/field_extraction.ipynb) | In this sample we will show how to create an analyzer to extract fields in your file. For example invoice amount in the document, how many people in an image, names mentioned in an audio, or summary of a video. You can customize the fields by creating your own analyzer template. |
139+
| [field_extraction_pro_mode.ipynb](notebooks/field_extraction_pro_mode.ipynb) | In this sample we will demonstrate how to use **Pro mode** in Azure AI Content Understanding to enhance your analyzer with multiple inputs and optional reference data. Pro mode is designed for advanced use cases, particularly those requiring multi-step reasoning, and complex decision-making (for instance, identifying inconsistencies, drawing inferences, and making sophisticated decisions).|
139140
| [classifier.ipynb](notebooks/classifier.ipynb) | This sample will demo how to (1) create a classifier to categorize documents, (2) create a custom analyzer to extract specific fields, and (3) combine classifier and analyzers to classify, optionally split, and analyze documents in a flexible processing pipeline. |
140141
| [conversational_field_extraction.ipynb](notebooks/conversational_field_extraction.ipynb) | This sample shows you how to evaluate conversational audio data that has previously been transcribed with Content Understanding or Azure AI Speech in in an efficient way to optimize processing quality. This also allows you to re-analyze data in a cost-efficient way. This sample is based on the [field_extraction.ipynb](notebooks/field_extraction.ipynb) sample. |
141142
| [analyzer_training.ipynb](notebooks/analyzer_training.ipynb) | If you want to futher boost the performance for field extraction, we can do training when you provide few labeled samples to the API. Note: This feature is available to document scenario now. |
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"baseAnalyzerId": "prebuilt-documentAnalyzer",
3+
"mode": "pro",
4+
"processingLocation": "global",
5+
"fieldSchema": {
6+
"name": "InvoiceContractVerification",
7+
"description": "Analyze invoice to confirm total consistency with signed contract.",
8+
"fields": {
9+
"PaymentTermsInconsistencies": {
10+
"type": "array",
11+
"method": "generate",
12+
"description": "List all areas of inconsistency identified in the invoice with corresponding evidence.",
13+
"items": {
14+
"$ref": "#/$defs/InvoiceInconsistency"
15+
}
16+
},
17+
"ItemInconsistencies": {
18+
"type": "array",
19+
"method": "generate",
20+
"description": "List all areas of inconsistency identified in the invoice in the goods or services sold (including detailed specifications for every line item).",
21+
"items": {
22+
"$ref": "#/$defs/InvoiceInconsistency"
23+
}
24+
},
25+
"BillingLogisticsInconsistencies": {
26+
"type": "array",
27+
"method": "generate",
28+
"description": "List all areas of inconsistency identified in the invoice regarding billing logistics and administrative or legal issues.",
29+
"items": {
30+
"$ref": "#/$defs/InvoiceInconsistency"
31+
}
32+
},
33+
"PaymentScheduleInconsistencies": {
34+
"type": "array",
35+
"method": "generate",
36+
"description": "List all areas of inconsistency identified in the invoice with corresponding evidence.",
37+
"items": {
38+
"$ref": "#/$defs/InvoiceInconsistency"
39+
}
40+
},
41+
"TaxOrDiscountInconsistencies": {
42+
"type": "array",
43+
"method": "generate",
44+
"description": "List all areas of inconsistency identified in the invoice with corresponding evidence regarding taxes or discounts.",
45+
"items": {
46+
"$ref": "#/$defs/InvoiceInconsistency"
47+
}
48+
}
49+
},
50+
"definitions": {
51+
"InvoiceInconsistency": {
52+
"type": "object",
53+
"method": "generate",
54+
"description": "Area of inconsistency in the invoice with the company's contracts.",
55+
"properties": {
56+
"Evidence": {
57+
"type": "string",
58+
"method": "generate",
59+
"description": "Evidence or reasoning for the inconsistency in the invoice."
60+
},
61+
"InvoiceField": {
62+
"type": "string",
63+
"method": "generate",
64+
"description": "Invoice field or the aspect that is inconsistent with the contract."
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)