Skip to content

Commit 769425d

Browse files
authored
Paul's feedback (Azure#24405)
1 parent 2f0a8b3 commit 769425d

File tree

6 files changed

+77
-77
lines changed

6 files changed

+77
-77
lines changed

sdk/formrecognizer/Azure.AI.FormRecognizer/MigrationGuide.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -469,31 +469,31 @@ await operation.WaitForCompletionAsync();
469469

470470
AnalyzeResult result = operation.Value;
471471

472-
Console.WriteLine("Detected entities:");
472+
Console.WriteLine("Detected key-value pairs:");
473473

474-
foreach (DocumentEntity entity in result.Entities)
474+
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
475475
{
476-
if (entity.SubCategory == null)
476+
if (kvp.Value.Content == null)
477477
{
478-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
478+
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
479479
}
480480
else
481481
{
482-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
482+
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
483483
}
484484
}
485485

486-
Console.WriteLine("Detected key-value pairs:");
486+
Console.WriteLine("Detected entities:");
487487

488-
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
488+
foreach (DocumentEntity entity in result.Entities)
489489
{
490-
if (kvp.Value.Content == null)
490+
if (entity.SubCategory == null)
491491
{
492-
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
492+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
493493
}
494494
else
495495
{
496-
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
496+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
497497
}
498498
}
499499

sdk/formrecognizer/Azure.AI.FormRecognizer/README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Azure Cognitive Services Form Recognizer client library for .NET
22
Azure Cognitive Services Form Recognizer is a cloud service that uses machine learning to analyze text and structured data from your documents. It includes the following main features:
33

4-
- Layout - Extract text, table structures, and selection marks, along with their bounding region coordinates, from documents.
5-
- Document - Analyze entities, key-value pairs, tables, and selection marks from documents using the general prebuilt document model.
6-
- Prebuilt - Analyze data from certain types of common documents (such as receipts, invoices, business cards, or identity documents) using pre-trained models.
7-
- Custom - Build custom models to analyze text, field values, selection marks, and table data from documents. Custom models are trained with your own data, so they're tailored to your documents.
4+
- Layout - Extract text, selection marks, and table structures, along with their bounding region coordinates, from documents.
5+
- Document - Analyze key-value pairs and entities in addition to general layout from documents.
6+
- Prebuilt - Analyze data from certain types of common documents (such as receipts, invoices, business cards, or identity documents) using prebuilt models.
7+
- Custom - Build custom models to analyze text, field values, selection marks, and tabular data from documents. Custom models are trained with your own data, so they're tailored to your documents.
88

99
[Source code][formreco_client_src] | [Package (NuGet)][formreco_nuget_package] | [API reference documentation][formreco_refdocs] | [Product documentation][formreco_docs] | [Samples][formreco_samples]
1010

@@ -134,13 +134,13 @@ var client = new DocumentAnalysisClient(new Uri(endpoint), new DefaultAzureCrede
134134

135135
|Model ID|Features
136136
|-|-
137-
|"prebuilt-layout"| Text extraction, selection marks, tables
138-
|"prebuilt-document"| Text extraction, selection marks, tables, key-value pairs and entities
139-
|"prebuilt-invoices"| Text extraction, selection marks, tables, and pre-trained fields and values pertaining to invoices
140-
|"prebuilt-businessCard"| Text extraction and pre-trained fields and values pertaining to business cards
141-
|"prebuilt-idDocument"| Text extraction and pre-trained fields and values pertaining to driver licenses and international passports
142-
|"prebuilt-receipt"| Text extraction and pre-trained fields and values pertaining to sales receipts
143-
|"{custom-model-id}"| Text extraction, selection marks, tables, labeled fields and values from your custom documents
137+
|`prebuilt-layout`| Text extraction, selection marks, tables
138+
|`prebuilt-document`| Text extraction, selection marks, tables, key-value pairs and entities
139+
|`prebuilt-invoices`| Text extraction, selection marks, tables, and pre-trained fields and values pertaining to invoices
140+
|`prebuilt-businessCard`| Text extraction and pre-trained fields and values pertaining to business cards
141+
|`prebuilt-idDocument`| Text extraction and pre-trained fields and values pertaining to driver licenses and international passports
142+
|`prebuilt-receipt`| Text extraction and pre-trained fields and values pertaining to sales receipts
143+
|`{custom-model-id}`| Text extraction, selection marks, tables, labeled fields and values from your custom documents
144144

145145
More information about analyzing documents, including supported features, locales, and which types of documents are supported can be found in the [service documentation][formreco_models].
146146

@@ -270,7 +270,7 @@ for (int i = 0; i < result.Tables.Count; i++)
270270
For more information and samples see [here][extract_layout].
271271

272272
### Use the Prebuilt Document Model
273-
Analyze entities, key-value pairs, tables, and selection marks from documents using the general prebuilt document model.
273+
Analyze key-value pairs, entities, tables, and selection marks from documents using the general prebuilt document model.
274274

275275
```C# Snippet:FormRecognizerAnalyzePrebuiltDocumentFromUriAsync
276276
string fileUri = "<fileUri>";
@@ -281,31 +281,31 @@ await operation.WaitForCompletionAsync();
281281

282282
AnalyzeResult result = operation.Value;
283283

284-
Console.WriteLine("Detected entities:");
284+
Console.WriteLine("Detected key-value pairs:");
285285

286-
foreach (DocumentEntity entity in result.Entities)
286+
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
287287
{
288-
if (entity.SubCategory == null)
288+
if (kvp.Value.Content == null)
289289
{
290-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
290+
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
291291
}
292292
else
293293
{
294-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
294+
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
295295
}
296296
}
297297

298-
Console.WriteLine("Detected key-value pairs:");
298+
Console.WriteLine("Detected entities:");
299299

300-
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
300+
foreach (DocumentEntity entity in result.Entities)
301301
{
302-
if (kvp.Value.Content == null)
302+
if (entity.SubCategory == null)
303303
{
304-
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
304+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
305305
}
306306
else
307307
{
308-
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
308+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
309309
}
310310
}
311311

sdk/formrecognizer/Azure.AI.FormRecognizer/samples/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ description: Samples for the Azure.AI.FormRecognizer client library
1515
1616
Azure Cognitive Services Form Recognizer is a cloud service that uses machine learning to analyze text and structured data from your documents. It includes the following main features:
1717

18-
- Layout - Extract text, table structures, and selection marks, along with their bounding region coordinates from documents.
19-
- Document - Analyze entities, key-value pairs, tables, and selection marks from documents using the general prebuilt document model.
20-
- Prebuilt - Analyze data from certain types of common documents (such as receipts, invoices, business cards, or identity documents) using pre-trained models.
21-
- Custom - Build custom models to analyze text, field values, selection marks, and table data from documents. Custom models are trained with your own data, so they're tailored to your documents.
18+
- Layout - Extract text, selection marks, and table structures, along with their bounding region coordinates, from documents.
19+
- Document - Analyze key-value pairs and entities in addition to general layout from documents.
20+
- Prebuilt - Analyze data from certain types of common documents (such as receipts, invoices, business cards, or identity documents) using prebuilt models.
21+
- Custom - Build custom models to analyze text, field values, selection marks, and tabular data from documents. Custom models are trained with your own data, so they're tailored to your documents.
2222

2323
## Common scenarios samples for client library version 4.0.0-beta.x
2424
- [Extract the layout of a document](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample_ExtractLayout.md)

sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample_AnalyzePrebuiltDocument.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Analyze with the prebuilt document model
22

3-
This sample demonstrates how to analyze entities, key-value pairs, tables, and selection marks from documents using the general prebuilt document model.
3+
This sample demonstrates how to analyze key-value pairs, entities, tables, and selection marks from documents using the general prebuilt document model.
44

55
To get started you'll need a Cognitive Services resource or a Form Recognizer resource. See [README][README] for prerequisites and instructions.
66

@@ -30,31 +30,31 @@ await operation.WaitForCompletionAsync();
3030

3131
AnalyzeResult result = operation.Value;
3232

33-
Console.WriteLine("Detected entities:");
33+
Console.WriteLine("Detected key-value pairs:");
3434

35-
foreach (DocumentEntity entity in result.Entities)
35+
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
3636
{
37-
if (entity.SubCategory == null)
37+
if (kvp.Value.Content == null)
3838
{
39-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
39+
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
4040
}
4141
else
4242
{
43-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
43+
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
4444
}
4545
}
4646

47-
Console.WriteLine("Detected key-value pairs:");
47+
Console.WriteLine("Detected entities:");
4848

49-
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
49+
foreach (DocumentEntity entity in result.Entities)
5050
{
51-
if (kvp.Value.Content == null)
51+
if (entity.SubCategory == null)
5252
{
53-
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
53+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
5454
}
5555
else
5656
{
57-
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
57+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
5858
}
5959
}
6060

@@ -134,31 +134,31 @@ await operation.WaitForCompletionAsync();
134134

135135
AnalyzeResult result = operation.Value;
136136

137-
Console.WriteLine("Detected entities:");
137+
Console.WriteLine("Detected key-value pairs:");
138138

139-
foreach (DocumentEntity entity in result.Entities)
139+
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
140140
{
141-
if (entity.SubCategory == null)
141+
if (kvp.Value.Content == null)
142142
{
143-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
143+
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
144144
}
145145
else
146146
{
147-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
147+
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
148148
}
149149
}
150150

151-
Console.WriteLine("Detected key-value pairs:");
151+
Console.WriteLine("Detected entities:");
152152

153-
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
153+
foreach (DocumentEntity entity in result.Entities)
154154
{
155-
if (kvp.Value.Content == null)
155+
if (entity.SubCategory == null)
156156
{
157-
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
157+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
158158
}
159159
else
160160
{
161-
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
161+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
162162
}
163163
}
164164

sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample_AnalyzePrebuiltDocumentFromFileAsync.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,31 @@ public async Task AnalyzePrebuiltDocumentFromFileAsync()
3434

3535
AnalyzeResult result = operation.Value;
3636

37-
Console.WriteLine("Detected entities:");
37+
Console.WriteLine("Detected key-value pairs:");
3838

39-
foreach (DocumentEntity entity in result.Entities)
39+
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
4040
{
41-
if (entity.SubCategory == null)
41+
if (kvp.Value.Content == null)
4242
{
43-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
43+
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
4444
}
4545
else
4646
{
47-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
47+
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
4848
}
4949
}
5050

51-
Console.WriteLine("Detected key-value pairs:");
51+
Console.WriteLine("Detected entities:");
5252

53-
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
53+
foreach (DocumentEntity entity in result.Entities)
5454
{
55-
if (kvp.Value.Content == null)
55+
if (entity.SubCategory == null)
5656
{
57-
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
57+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
5858
}
5959
else
6060
{
61-
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
61+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
6262
}
6363
}
6464

sdk/formrecognizer/Azure.AI.FormRecognizer/tests/samples/Sample_AnalyzePrebuiltDocumentFromUriAsync.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@ public async Task AnalyzePrebuiltDocumentFromUriAsync()
3232

3333
AnalyzeResult result = operation.Value;
3434

35-
Console.WriteLine("Detected entities:");
35+
Console.WriteLine("Detected key-value pairs:");
3636

37-
foreach (DocumentEntity entity in result.Entities)
37+
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
3838
{
39-
if (entity.SubCategory == null)
39+
if (kvp.Value.Content == null)
4040
{
41-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
41+
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
4242
}
4343
else
4444
{
45-
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
45+
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
4646
}
4747
}
4848

49-
Console.WriteLine("Detected key-value pairs:");
49+
Console.WriteLine("Detected entities:");
5050

51-
foreach (DocumentKeyValuePair kvp in result.KeyValuePairs)
51+
foreach (DocumentEntity entity in result.Entities)
5252
{
53-
if (kvp.Value.Content == null)
53+
if (entity.SubCategory == null)
5454
{
55-
Console.WriteLine($" Found key with no value: '{kvp.Key.Content}'");
55+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}'.");
5656
}
5757
else
5858
{
59-
Console.WriteLine($" Found key-value pair: '{kvp.Key.Content}' and '{kvp.Value.Content}'");
59+
Console.WriteLine($" Found entity '{entity.Content}' with category '{entity.Category}' and sub-category '{entity.SubCategory}'.");
6060
}
6161
}
6262

0 commit comments

Comments
 (0)