Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
90 lines (51 loc) · 5.41 KB

File metadata and controls

90 lines (51 loc) · 5.41 KB

Demo 2 - Using Form Recognizer

Demo 2

Summary

In this exercise we learn how to use the Form Recognizer service. It is assumed that a storage account has been created (as described in the first demo.)

What you need

Azure Resources

The only resource we work with in this demonstration is the Form Recognizer service.

Name Type Purpose
ttinvoicereader Form Recognizer Service This service will eventually end up in the All-In-One sevice. For right now it is in limited-access preview. To get access to the preview, fill out and submit the Form Recognizer access request form.

What to do

There are three main steps:

  1. Upload training data to the storage account
  2. Create Form Recognizer service
  3. Train and Use Form Recognizer service

Upload Training Data

  1. Create a container called train in the storage account created in the previous demo.

Create Container

  1. Download and unzip invoice training set.

  2. Upload unzipped invoice training set to the train container. This can be done directly using the portal or by using the Azure Storage Explorer (as shown in the video).

Create Form Recognizer service

In order to do this you must have access to the Form Recognizer preview. To get access to the preview, fill out and submit the Form Recognizer access request form.

Form Recognizer

Train the Form Recognizer Service

This section uses Postman and assumes you know about loading collections, handling variables, and setting pre-request scripts. To learn how to do these specific things we have included some instructions.

The table below lists the variables set during this section of the exercise:

Name Type Purpose
Ocp-Apim-Subscription-Key Authorization Key for getting access to Form Recognizer service
endpoint Variable Specifies the Form Recognizer endpoint
modelId Variable Current Form Recognizer model (this is set in step 5)
  1. Load the Form Recognizer collection into Postman.

  2. Set the Ocp-Apim-Subscription-Key authorization header as well as the endpoint variable to the Form Recognizer service (these can be found in the portal).

  3. Open the TrainModel Request and change the Pre-request script to set the storageAccount variable to your storage account (in the video the variable is ttinvoicestorage) and the SASValue to the appropriate Secure Access Signature to the train container. To learn how to get a Secure Access Signature, refer to our brief explanation.

pm.environment.set('storageAccount', '<YOUR STORAGE ACCOUNT>')
pm.environment.set('container', 'train')
pm.environment.set('SASValue', '<SAS>')
  1. Hit Send on the Request. Your response should look something like this:

Training Response

  1. Set the modelId variable for the collection to the returned modelId indicated above.

Use the Form Recognizer Service

  1. Open the AnalyzeForm request. In the Body section click on the Select Files button to choose an invoice downloaded previously. After sending the request you should get something similar to:

Inference Response

Next Demo

Learn how to create custom Invoice Reader Skill with Azure Functions by continuing on to Demo 3 - Creating a Custom Invoice Reader Skill