You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/applied-ai-services/form-recognizer/how-to-guides/includes/v2-1/csharp-sdk.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ manager: nitinme
6
6
ms.service: applied-ai-services
7
7
ms.subservice: forms-recognizer
8
8
ms.topic: include
9
-
ms.date: 09/16/2022
9
+
ms.date: 02/14/2023
10
10
ms.author: lajanuar
11
11
ms.custom: devx-track-csharp
12
12
---
@@ -28,10 +28,8 @@ ms.custom: devx-track-csharp
28
28
* The [Visual Studio IDE](https://visualstudio.microsoft.com/vs/) or current version of [.NET Core](https://dotnet.microsoft.com/download/dotnet-core).
29
29
* An Azure Storage blob that contains a set of training data. See [Build a training data set for a custom model](../../../build-training-data-set.md) for tips and options for putting together your training data set. For this project, you can use the files under the **Train** folder of the [sample data set](https://go.microsoft.com/fwlink/?linkid=2090451) (download and extract *sample_data.zip*).
30
30
* Once you have your Azure subscription, <ahref="https://portal.azure.com/#create/Microsoft.CognitiveServicesFormRecognizer"title="Create a Form Recognizer resource"target="_blank">create a Form Recognizer resource </a> in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
31
-
* You'll need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the code below later in the project.
31
+
* You need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the sample code later in the project.
32
32
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
33
-
> [!TIP]
34
-
> Create a Cognitive Services resource if you plan to access multiple cognitive services under a single endpoint/key. For Form Recognizer access only, create a Form Recognizer resource. Please note that you'll need a single-service resource if you intend to use [Azure Active Directory authentication](../../../../../active-directory/authentication/overview-authentication.md).
35
33
36
34
## Setting up
37
35
@@ -78,7 +76,7 @@ In the application's **Program** class, create variables for your resource's key
@@ -98,8 +96,8 @@ With Form Recognizer, you can create two different client types. The first, `For
98
96
99
97
`FormTrainingClient` provides operations for:
100
98
101
-
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model will analyze, and the fields it will extract for each form type.
102
-
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model will extract, and the estimated accuracy for each field.
99
+
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model analyzes, and the fields it extracts for each form type.
100
+
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model extracts, and the estimated accuracy for each field.
103
101
* Managing models created in your account.
104
102
* Copying a custom model from one Form Recognizer resource to another.
105
103
@@ -110,7 +108,7 @@ See examples for [Train a Model](#train-a-custom-model) and [Manage Custom Model
110
108
111
109
## Authenticate the client
112
110
113
-
Below **Main**, create a new method named `AuthenticateClient`. You'll use this method in other tasks to authenticate your requests to the Form Recognizer service. This method uses the `AzureKeyCredential` object, so that if needed, you can update the key without creating new client objects.
111
+
Below **Main**, create a new method named `AuthenticateClient`. You use this method in other tasks to authenticate your requests to the Form Recognizer service. This method uses the `AzureKeyCredential` object, so that if needed, you can update the key without creating new client objects.
114
112
115
113
> [!IMPORTANT]
116
114
> Get your key and endpoint from the Azure portal. If the Form Recognizer resource you created in the **Prerequisites** section deployed successfully, click the **Go to Resource** button under **Next Steps**. You can find your key and endpoint in the resource's **key and endpoint** page, under **resource management**.
@@ -119,20 +117,20 @@ Below **Main**, create a new method named `AuthenticateClient`. You'll use this
You'll also need to add references to the URLs for your training and testing data. Add these references to the root of your **Program** class.
126
+
You also need to add references to the URLs for your training and testing data. Add these references to the root of your **Program** class.
129
127
130
-
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and click**Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
128
+
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and select**Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
131
129
132
130
:::image type="content" source="../../../media/quickstarts/get-sas-url.png" alt-text="Screenshot of SAS URL retrieval.":::
133
131
134
132
* Then, repeat the above steps to get the SAS URL of an individual document in blob storage container. Save it to a temporary location as well.
135
-
* Finally, save the URL of the sample image(s) included below (also available on [GitHub](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_forms)).
133
+
* Finally, save the URL of the included sample image(s) (also available on [GitHub](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_forms)).
@@ -424,9 +422,9 @@ Submodel Form Type: form-63c013e3-1cab-43eb-84b0-f4b20cb9214c
424
422
This section demonstrates how to extract key/value information and other content from your custom template types, using models you trained with your own forms.
425
423
426
424
> [!IMPORTANT]
427
-
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the method below.
425
+
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the following method.
428
426
429
-
You'll use the `StartRecognizeCustomFormsFromUri` method.
427
+
You use the `StartRecognizeCustomFormsFromUri` method.
@@ -603,7 +601,7 @@ If you want to clean up and remove a Cognitive Services subscription, you can de
603
601
604
602
## Troubleshooting
605
603
606
-
When you interact with the Cognitive Services Form Recognizer client library using the .NET SDK, errors returned by the service will result in a `RequestFailedException`. They'll include the same HTTP status code that would have been returned by a REST API request.
604
+
When you interact with the Cognitive Services Form Recognizer client library using the .NET SDK, errors returned by the service result in a `RequestFailedException`. They include the same HTTP status code that would have been returned by a REST API request.
607
605
608
606
For example, if you submit a receipt image with an invalid URI, a `400` error is returned, indicating "Bad Request".
Copy file name to clipboardExpand all lines: articles/applied-ai-services/form-recognizer/how-to-guides/includes/v2-1/java-sdk.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ manager: nitinme
6
6
ms.service: applied-ai-services
7
7
ms.subservice: forms-recognizer
8
8
ms.topic: include
9
-
ms.date: 09/16/2022
9
+
ms.date: 02/14/2023
10
10
ms.custom: devx-track-java
11
11
ms.author: lajanuar
12
12
---
@@ -27,11 +27,10 @@ ms.author: lajanuar
27
27
* The current version of the [Java Development Kit (JDK)](https://www.oracle.com/technetwork/java/javase/downloads/index.html)
28
28
* The [Gradle build tool](https://gradle.org/install/), or another dependency manager.
29
29
* Once you have your Azure subscription, <ahref="https://portal.azure.com/#create/Microsoft.CognitiveServicesFormRecognizer"title="Create a Form Recognizer resource"target="_blank">create a Form Recognizer resource </a> in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
30
-
* You'll need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the code below.
30
+
* You need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the sample code.
31
31
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
32
32
* An Azure Storage blob that contains a set of training data. See [Build a training data set for a custom model](../../../build-training-data-set.md) for tips and options for putting together your training data set. For this project, you can use the files under the **Train** folder of the [sample data set](https://go.microsoft.com/fwlink/?linkid=2090451) (download and extract *sample_data.zip*).
33
-
> [!TIP]
34
-
> Create a Cognitive Services resource if you plan to access multiple cognitive services under a single endpoint/key. For Form Recognizer access only, create a Form Recognizer resource. Please note that you'll need a single-service resource if you intend to use [Azure Active Directory authentication](../../../../../active-directory/authentication/overview-authentication.md).
33
+
35
34
36
35
## Setting up
37
36
@@ -47,7 +46,7 @@ mkdir myapp && cd myapp
47
46
mkdir myapp; cd myapp
48
47
```
49
48
50
-
Run the `gradle init` command from your working directory. This command will create essential build files for Gradle, including *build.gradle.kts*, which is used at runtime to create and configure your application.
49
+
Run the `gradle init` command from your working directory. This command creates essential build files for Gradle, including *build.gradle.kts*, which is used at runtime to create and configure your application.
51
50
52
51
```console
53
52
gradle init --type basic
@@ -98,9 +97,9 @@ In the application's **FormRecognizer** class, create variables for your resourc
98
97
>
99
98
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use secure methods to store and access your credentials. For more information, *see* Cognitive Services [security](../../../../../cognitive-services/security-features.md).
100
99
101
-
In the application's **main** method, add calls for the methods used in this project. You'll define these calls later. You'll also need to add references to the URLs for your training and testing data.
100
+
In the application's **main** method, add calls for the methods used in this project. You define these calls later. You also need to add references to the URLs for your training and testing data.
102
101
103
-
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and click**Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
102
+
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and select**Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
104
103
105
104
:::image type="content" source="../../../media/quickstarts/get-sas-url.png" alt-text="Screenshot of SAS URL retrieval.":::
106
105
@@ -128,8 +127,8 @@ With Form Recognizer, you can create two different client types. The first, `For
128
127
129
128
`FormTrainingClient` provides operations for:
130
129
131
-
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model will analyze, and the fields it will extract for each form type.
132
-
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model will extract and the estimated accuracy for each field.
130
+
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model analyzes, and the fields it extracts for each form type.
131
+
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model extracts and the estimated accuracy for each field.
133
132
* Managing models created in your account.
134
133
* Copying a custom model from one Form Recognizer resource to another.
135
134
@@ -138,7 +137,7 @@ With Form Recognizer, you can create two different client types. The first, `For
138
137
139
138
## Authenticate the client
140
139
141
-
At the top of your **main** method, add the following code. Here, you'll authenticate two client objects using the subscription variables you defined above. You'll use an **AzureKeyCredential** object, so that if needed, you can update the key without creating new client objects.
140
+
At the top of your **main** method, add the following code. Here, you authenticate two client objects using the subscription variables you defined previously. You use an **AzureKeyCredential** object, so that if needed, you can update the key without creating new client objects.
@@ -335,9 +334,9 @@ The model found field 'field-6' with label: VAT ID
335
334
This section demonstrates how to extract key/value information and other content from your custom template types, using models you trained with your own forms.
336
335
337
336
> [!IMPORTANT]
338
-
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the method below. See the [Train a model](#train-a-model-without-labels) section.
337
+
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the method operation. See the [Train a model](#train-a-model-without-labels) section.
339
338
340
-
You'll use the **beginRecognizeCustomFormsFromUrl** method.
339
+
You use the **beginRecognizeCustomFormsFromUrl** method.
@@ -365,7 +364,7 @@ Field 'field-6' has label 'VAT ID' with a confidence score of 1.00.
365
364
366
365
## Manage custom models
367
366
368
-
This section demonstrates how to manage the custom models stored in your account. The following code does all of the model management tasks in a single method, as an example. Start by copying the method signature below:
367
+
This section demonstrates how to manage the custom models stored in your account. The following code does all of the model management tasks in a single method, as an example. Start by copying the following method signature:
Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and speeding up their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help locate the root issue. View the [logging wiki](https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK) for guidance about enabling logging.
450
+
Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and speeding up their resolution. The logs produced capture the flow of an application before reaching the terminal state to help locate the root issue. View the [logging wiki](https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK) for guidance about enabling logging.
0 commit comments