01 Plan An Azure AI Document Intelligence Solution
01 Plan An Azure AI Document Intelligence Solution
• It can recognize text values in both common forms and forms that are unique
to your business.
• In this module, we consider this scenario: You work for a company that
conducts polls for private companies and political parties.
• You currently spend a lot of time and money entering these responses into
databases.
• You want to assess Azure AI Document Intelligence to find out if you can use it
to streamline this process.
• You need to understand what data Azure AI Document Intelligence can obtain
from the different polling forms you use and how your development team will
build a AI data entry system and integrate it with your mobile and desktop
apps and databases.
• In this unit, you'll learn what Azure AI Document Intelligence does and how
developers can configure it to support their forms and documents.
Understand AI Document
Intelligence
What is Azure AI Document
Intelligence?
• Until recently, getting data from a completed form into a database or any other data
store required someone to enter it manually.
• Manual data entry is a slow and intensive task and can be expensive, especially if you
have thousands of forms to enter.
• Operators often make reading or typing errors that reduce the accuracy of your data.
• Manual data entry was the only option because it was difficult for computers to recognize
printed or hand-written text.
• Now, AI has become commonplace and has enabled computers to recognize patterns,
such as letter shapes in a piece of text, with a high degree of accuracy.
• We can use AI as an alternative to manual data entry with lower costs and fewer errors in
the extracted data.
• Azure AI Document Intelligence is an Azure service that you can use to analyze forms
completed by your customers, partners, employers, or others and extract the data that
they contain.
Understand AI Document
Intelligence
What is Azure AI Document
Intelligence?
Understand AI Document
Intelligence
Responsible use of AI
• AI technologies are powerful and have the potential to make great impacts on
people's lives. To ensure that such impacts are positive, Microsoft uses the
following principles when it designs and builds AI solutions. You should consider
these principles whenever you make use of AI:
• Fairness. All AI systems should treat people fairly, regardless of race, belief,
gender, sexuality, or other factors.
• Reliability and safety. All AI systems should give reliable answers with
quantifiable confidence levels.
• Privacy and security. All AI systems should secure and protect sensitive
data and operate within applicable data protection laws.
• Inclusiveness. All AI systems should be available to all users, regardless of
their abilities.
• Transparency. All AI systems should operate understandably and openly.
• Accountability. All AI systems should be run by people who are accountable
for the actions of those systems.
Understand AI Document
Intelligence
Using models with Azure AI Document Intelligence
• Use a model to inform Azure AI Document Intelligence about the type of data
you expect to be in the documents you're analyzing.
• If your forms have a common structure or layout, you can increase the accuracy
of the results and control the structure of the output data by using the most
appropriate model.
• If your forms are of one of these types, you can extract information from them
without training your own custom models.
• It's very quick to create and deploy an Azure AI Document Intelligence solution
when you use prebuilt models.
Understand AI Document
Intelligence
Using models with Azure AI Document Intelligence
• In Azure AI Document Intelligence, three of the prebuilt models are for general
document analysis:
• Read
• General document
• Layout
• The other prebuilt models expect a common type of form or document:
• Invoice
• Receipt
• W-2 US tax declaration
• ID Document
• Business card
• Health insurance card
Understand AI Document
Intelligence
Using models with Azure AI Document Intelligence
• If you have an unusual or unique type of form, you can use the above general
document analysis prebuilt models to extract information from them.
• However, if you want to extract more specific information than the prebuilt
models support, you can create a custom model and train it by using examples
of completed forms.
• You can also associate multiple custom models, trained on different types of
document, into a single model, known as a composed model.
• With a composed model, users can submit forms of different types to a single
service, which identifies them and selects the most appropriate custom model to
use in their analysis.
Understand AI Document
Intelligence
Azure AI Document Intelligence and Azure AI Vision
• As an Azure AI Service, Azure AI Document Intelligence is a high-level AI service
that enables developers to access data in forms quickly.
• It's built on the lower level Azure AI Services, including Azure AI Vision.
• If you use Azure AI Vision with its Optical Character Recognition (OCR) feature,
you can submit photographed or scanned documents and extract their words
and text in JSON format.
• If you want to extract simple words and text from a picture of a form or
document, without contextual information, Azure AI Vision OCR is an appropriate
service to consider.
• You might want to use this service if you already have your own analysis code,
for example.
Understand AI Document
Intelligence
Azure AI Document Intelligence and Azure AI Vision
• However, Azure AI Document Intelligence includes a more sophisticated analysis
of documents.
• For example, it can identify key/value pairs, tables, and context-specific fields.
• If you want to deploy a complete document analysis solution that enables users
to both extract and understand text, consider Azure AI Document Intelligence.
Understand AI Document
Intelligence
Azure AI Document Intelligence tools
• If you want to try many features of Azure AI Document Intelligence without writing any
code, you can use Azure AI Document Intelligence Studio.
• This provides a visual tool for exploring and understanding the capabilities of Azure AI
Document Intelligence and its support for your forms.
• For example, you can use Azure AI Document Intelligence Studio to try analyzing your sales
invoices and to explore the data produced by the Invoice prebuilt model.
• Then you could decide whether the prebuilt model extracts the values you need or whether
to create your own custom model for a more unusual type of invoice.
• To integrate Azure AI Document Intelligence into your own applications you'll need to write
code.
• For example, you could enable users of your sales mobile app to scan receipts with their
device's camera and call Azure AI Document Intelligence to obtain prices, costs, and
custom details.
• The app could store this information in your customer relationship management database.
Understand AI Document
Intelligence
Azure AI Document Intelligence tools
• Azure AI Document Intelligence includes Application Programming Interfaces
(APIs) for each of the model types you've seen. The following languages are
supported:
• C#/.NET
• Java
• Python
• JavaScript
• If you prefer to use another language, you can call Azure AI Document
Intelligence by using its RESTful web service.
Plan Azure AI Document Intelligence
resources
• To build an Azure AI Document Intelligence solution, you must create and
configure the necessary resources in your Azure subscription.
• In this unit, you'll learn how to choose and create Azure AI Document Intelligence
resources.
Plan Azure AI Document Intelligence
resources
Azure AI Document Intelligence resources
• Azure AI Document Intelligence is an Azure service and conforms to Azure's
resource management model.
• When you create an Azure AI Document Intelligence resource, you can choose
from Free (F0) or Standard (S0) tiers.
Plan Azure AI Document Intelligence
resources
Create an Azure AI Document Intelligence
resource
• To create an Azure AI Document Intelligence resource in Azure and obtain
connection details, complete these steps:
• Access key. This is unique string that Azure uses to authenticate the call to
Azure AI Document Intelligence.
3. Copy either KEY 1 or KEY 2 and the Endpoint values and store them for use
in your application code.
Plan Azure AI Document Intelligence
resources
Connect to Azure AI Document Intelligence
• The following code shows how to use
these connection details to connect
your application to Azure AI
Document Intelligence.
• You can either use one of the prebuilt models, if you have a common type of document,
or create and train your own models.
• In your polling company, you use many different forms for surveys for different clients.
• They have some fields in common, such as "Respondent Name" and "Contact Telephone"
but other fields are unique to each client company or party.
• You want to choose which models to use in your Document Intelligence solution and plan
how to create them.
• In this unit, you'll learn about the prebuilt models available in Azure AI Document
Intelligence and when to create your own custom and composed models.
Choose a model type
Prebuilt models
• Document types such as invoices and receipts vary in different businesses and industry
but have similar structures and key-value pairs.
• For example, a "Total cost" value is likely to appear on almost all invoices although it
might be called "Total", "Sum", or some other name.
• Microsoft has provided a set of prebuilt models with Azure AI Document Intelligence to
handle the most common types of documents.
• You don't have to train these models and you can create solutions using them very
quickly.
Choose a model type
General document analysis
models
• Three of the prebuilt models are
designed to handle general
documents and extract words,
lines, structure and other
information such as the
language the document is
written in:
• The general document analyzer prebuilt models can extract rich information from these
forms and you might be able to use them if your requirements are to obtain general data.
• However, by using a custom model, trained on forms with similar structures and key-value
pairs, you will obtain more predictable and standardized results from your unusual form
types.
• To train a custom model, you must supply at least five examples of the completed form but
the more examples you supply, the greater the confidence levels Azure AI Document
Intelligence will return when it analyzes input.
• The more varied your documents are in terms of structure and terminology, the greater the
number of example documents you will need to supply to train a reliable model.
• You can either supply a labeled dataset to describe the expected data or allow the model to
identify key-value pairs and table data based on what it finds in the example forms.
• Also, make sure your training forms include examples that span the full range of possible
input. For example, if you are expecting both hand-written and printed entries, include them
Choose a model type
Custom models
• Once you have trained a custom model in this way, Azure AI Document
Intelligence can accurately and predictably identify information in your unique
forms.
Choose a model type
Custom models
• There are two kinds of custom model:
• If you remove all the user-entered data from the forms and find that the blank
forms are identical, use a custom template model.
• Custom template models support 9 different languages for handwritten text and a
wide range of languages for printed text.
• If you have a few different variations of the form templates, train a model for
each of the variations and then compose the models together into a single model.
• The service will invoke the model best suited to analyze the document.
Choose a model type
Composed models
• A composed model is one that consists of multiple custom models.
• Typical scenarios where composed models help are when you don't know the submitted
document type and want to classify and then analyze it.
• They are also useful if you have multiple variations of a form, each with a trained individual
model.
• When a user submits a form to the composed model, Document Intelligence automatically
classifies it to determine which of the custom models should be used in its analysis.
• In this approach, a user doesn't have to know what kind of document it is before submission.
• That can be helpful when you're using lots of similar forms or when you want to publish a single
endpoint for all your form types.
• If you're using the Standard pricing tier, you can add up to 100 custom models into a single
composed model.
• If you're using the Free pricing tier, you can only add up to 5 custom models.
Knowledge check
1. You want to create an Azure AI Document Intelligence model where the documents
are in one of three formats: wills, probate declarations, and affidavits. Each has their
own specific layout. What type of model should you use that will understand the
format of the three document categories?
a) A Read model.
b) A Layout model.
c) A Composed model.
2. You have developed a custom model that analyzes health assessment forms
returned by patients to a medical practice. You've observed too much inaccuracy in
the values that the model extracts for each field. What should you do to address this
problem?
h) Employment record
i) Resume
j) Receipt