![Capture of the iconic rock formations and azure seas in Amalfi, Italy.](https://images.pexels.com/photos/3009067/pexels-photo-3009067.jpeg?auto=compress&cs=tinysrgb&w=1920)
Azure Form Recognizer is a powerful tool that can significantly streamline your file and document processing tasks. It uses pre-built models to extract data from various types of documents, including forms, receipts, and invoices.
With Azure Form Recognizer, you can automate the process of extracting key information from documents, reducing manual data entry and increasing productivity. This tool is particularly useful for businesses that deal with high volumes of documents.
One of the key benefits of Azure Form Recognizer is its ability to extract data from documents in multiple formats, including PDF, JPEG, and PNG. This flexibility makes it an ideal solution for companies that work with a variety of document types.
You might like: Azure Data Studio vs Azure Data Explorer
What Is Azure Form Recognizer?
Azure Form Recognizer is an artificial intelligence service that lets you analyze PDFs and forms using pre-built models that can be changed.
It has built-in models that work with standard forms like W-2s, invoices, receipts, business cards, and other similar forms.
Discover more: Azure Forms
Form Recognizer also has training support for custom training, which lets it fine-tune its powerful neural document models and support proprietary datasets.
This means you can use Form Recognizer to analyze a wide range of documents, including receipts, invoices, and IDs.
It can recognize over 160 languages of printed text and a few languages of handwritten text, making it a versatile tool for global businesses.
You can also build a custom model to process your specific set of forms, giving you even more flexibility and control over the data you extract.
Benefits and Features
Azure Form Recognizer is a powerful tool that can process forms quickly and accurately, saving you time and money by automating data entry.
The service can handle a large volume of receipts and forms in a short amount of time, making it perfect for businesses with high volumes of forms to process.
One of the standout features of Azure Form Recognizer is its ability to learn and recognize forms specific to your company, making it a highly useful tool for managing and analyzing data.
A unique perspective: Azure Data Studio Connect to Azure Sql
With Azure Form Recognizer, you can easily integrate the extracted data into your existing systems, such as databases, customer relationship management systems, and business intelligence tools.
The service is also highly secure, using Microsoft's tried-and-true cloud infrastructure to keep sensitive information safe and out of the public eye.
Here are some additional benefits of using Azure Form Recognizer:
- Better accuracy: Azure Form Recognizer uses deep learning techniques to pull information from a wide range of forms, even ones with different layouts or bad structures.
- Improved Data Quality: The service guarantees reliable, correct, and error-free data extraction, thanks to automation.
- Reduced Processing Time: With Azure Form Recognizer, you can quickly process a large number of forms, saving you time and money.
- Integration: The service connects quickly to other Azure apps and services, allowing you to pull data and use it in various workflows.
- Scalability: Azure Form Recognizer can quickly grow to handle a huge number of forms, thanks to its globally distributed cloud architecture.
- Cost-Efficient: You only pay for the resources you use, with no upfront costs for hardware or software.
- Accessible from Any Location: The service can be used from anywhere with an internet connection, making it perfect for remote workers or businesses with multiple locations.
Getting Started
To get started with Azure Form Recognizer, you'll need to have the right prerequisites in place. Python 3.8 or later is required, and you must have an Azure subscription and a Cognitive Services or Form Recognizer resource to use this package.
First, you'll need to create a Form Recognizer resource. You can create it using the Azure Portal or the Azure CLI. If you plan to access multiple cognitive services under a single endpoint/key, create a Cognitive Services resource. Otherwise, create a Form Recognizer resource specifically for Form Recognizer access.
To create a Form Recognizer resource using the CLI, you can use the following command. But before you can create a client instance, you'll need the endpoint of your Form Recognizer resource and a credential.
Additional reading: Azure Access
You can find the endpoint for your Form Recognizer resource in the Azure Portal or by using the Azure CLI. The Form Recognizer clients can use either an AzureKeyCredential with an API key of your resource or a TokenCredential that uses Azure Active Directory RBAC to authorize the client.
Here are the options for creating a Form Recognizer resource:
- Azure Portal
- Azure CLI
Document Model Administration
You can use the DocumentModelAdministrationClient to build custom models that analyze specific fields in your documents. These models can be used to identify and extract relevant information from your documents.
The DocumentModelAdministrationClient provides several operations, including building custom models, creating composed models, and managing existing models. You can also list operations or get a specific model operation created within the last 24 hours.
To build a custom model, you can label your custom documents and specify the fields you want the model to analyze. The model will return a DocumentModelDetails indicating the document type(s) it can analyze and the estimated confidence for each field.
You can also copy a custom model from one Form Recognizer resource to another using the DocumentModelAdministrationClient.
Here are some ways to manage your custom models:
- Building custom models to analyze specific fields you specify by labeling your custom documents.
- Creating a composed model from a collection of existing models.
- Managing models created in your account.
- Listing operations or getting a specific model operation created within the last 24 hours.
- Copied a custom model from one Form Recognizer resource to another.
Additionally, you can use the FormTrainingClient to list all models in your Form Recognizer resource.
Custom Models
Custom models in Azure Form Recognizer are a powerful tool for analyzing specific fields in your documents. You can build custom models to analyze values from the types of documents it was trained on.
To build a custom model, you'll need to provide a container SAS URL to your Azure Storage Blob container where you're storing the training documents. This is where you'll upload your documents for training.
A custom model can be used to analyze document fields, tables, selection marks, and more. These models are trained with your own data, so they're tailored to your documents.
When using a custom model, it's best to only analyze documents of the same document type that the custom model was built with. This ensures the most accurate results.
You can also copy a custom model from one Form Recognizer resource to another, making it easy to share and reuse models across your organization.
Here are the different types of models you can build:
A custom model can be built using a graphical user interface such as Document Intelligence Studio, or through code using a DocumentModelAdministrationClient. This client provides operations for building custom models, creating composed models, managing models, and more.
Prebuilt Models
Prebuilt Models are a game-changer for extracting fields from common forms like receipts, invoices, and business cards. You can use prebuilt models provided by the Form Recognizer service to extract fields from these types of forms.
For example, to extract fields from a sales receipt, you can use the prebuilt receipt model provided by the beginRecognizeReceipts method. This method is specifically designed to extract fields from receipts, and it's a great way to get started with Form Recognizer.
Consider reading: How to Use Microsoft Azure
The Form Recognizer service provides several prebuilt models, each with its own set of supported fields. Here are some of the prebuilt models you can use:
- Receipts, through the beginRecognizeReceipts method
- Business cards, through beginRecognizeBusinessCards
- Invoices, through beginRecognizeInvoices
- Identity Documents (such as driver licenses and passports), through beginRecognizeIdDocuments
These prebuilt models are designed to make it easy to extract fields from common forms, saving you time and effort in the process.
Training and Models
You can build custom models to analyze specific fields you specify by labeling your custom documents. This is done using the DocumentModelAdministrationClient, which provides operations for building custom models, creating composed models, and managing models created in your account.
To build a custom model, you'll need to provide a container SAS URL to your Azure Storage Blob container where you're storing the training documents. This is explained in the "Build a Custom Model" section.
A custom model should only be used with documents of the same document type that it was trained on, for best results. This is because the model is tailored to your specific documents.
You can also train custom models to recognize fields and values found in your custom forms without providing any label data. This is done using the FormTrainingClient, which provides operations for training custom models, managing models, and copying models.
Form Recognizer provides the following types of models: Read OCR, Layout Analysis, General Document, Prebuilt, and Custom models. The first three models provide low-level information in their output, while the last two options have a more intelligent output.
Here's a breakdown of the different types of models provided by Form Recognizer:
This list shows the different types of models provided by Form Recognizer, and what each one does.
API and Authentication
To interact with the Form Recognizer service, you'll need to create a client instance with the endpoint of your Form Recognizer resource and a credential. You can find the endpoint in the Azure Portal or by using the Azure CLI.
You can use either an AzureKeyCredential with an API key or a TokenCredential that uses Azure Active Directory RBAC to authorize the client. Sometimes the API key is referred to as a "subscription key" or "subscription API key."
To get started, you'll need to create a Form Recognizer resource using the Azure Portal or Azure CLI. You can also use a custom subdomain, but this can only be used by single-service resources. A regional endpoint is the same for every resource in a region, and can be found in a complete list of supported regional endpoints.
Get the Endpoint
To get the endpoint for your Form Recognizer resource, you can use the Azure Portal or Azure CLI.
You can find the endpoint by using either a regional endpoint or a custom subdomain, which are formatted in a specific way.
Regional endpoints are the same for every resource in a region, and a complete list of supported regional endpoints can be consulted here.
Note that regional endpoints do not support AAD authentication.
To use a custom subdomain for authentication, you'll need to format it in a specific way.
You can find the complete list of supported regional endpoints to determine which one to use for your resource.
Discover more: Azure Auth Json Website Azure Ad Authentication
API Key Usage
You can use an API key to authenticate your client instance to access the Form Recognizer API. The API key is also known as a "subscription key" or "subscription API key".
To get an API key, browse to your Form Recognizer resource in the Azure Portal or use the Azure CLI snippet provided in Example 2. The API key can be used as a credential for the Form Recognizer clients.
You can use the API key with either a regional endpoint or a custom subdomain for authentication, as mentioned in Example 3. Regional endpoints do not support AAD authentication, but custom subdomains do.
To use the API key, you'll need to set it as an environment variable or pass it as a parameter to the client instance. The API key can be used with either the AzureKeyCredential or the TokenCredential.
Here's a summary of the API key usage:
Libraries and Examples
The Azure Form Recognizer client libraries are available for Python, JavaScript, and .NET. You can find the source code and API reference documentation for each library on the official Azure website.
The Python library has a new feature called TargetAuthorization, which is a dictionary of strings. This is a useful addition for developers who want to authenticate their requests.
The JavaScript library uses cloud-based machine learning to extract structured data from form documents. Its features include Custom Form Models and Content API, which allow you to create and manage custom models, as well as extract raw page elements from documents.
Here are some common use cases for the Form Recognizer client libraries:
- Recognize forms using a custom model
- Recognize content
- Use prebuilt models
- Train a model
- List all models
The .NET library has similar features to the other libraries, including layout, general document, read, prebuilt, custom analysis, and custom classification. It also supports both synchronous and asynchronous APIs.
Here are some examples of how to install the Azure Form Recognizer client libraries:
- For Python, you can install the library using pip: `pip install azure-formrecognizer`
- For JavaScript, you can install the library using npm: `npm install @azure/ai-form-recognizer`
- For .NET, you can install the library using NuGet: `Install-Package Azure.AI.FormRecognizer`
You can find more sample code and examples on the official Azure website, including sync examples and more.
Release Notes
Release Notes for Azure Form Recognizer involve significant updates to the service's features and functionality.
Starting with version 2021-09-30-preview, a new set of clients were introduced to leverage the newest features of the Form Recognizer service. These updates include new methods and models for document analysis and model administration.
Key updates include the addition of new DocumentAnalysisClient and DocumentModelAdministrationClient, which provide methods for analyzing documents and managing models. The new clients also include new models for document analysis and model administration.
Here are some of the key updates in the release notes:
- New methods for document analysis and model administration
- New models for document analysis and model administration
- Support for prebuilt and custom models
- Ability to create and manage composed models
3.2.0b1 (2021-10-07)
With the release of 3.2.0b1 on October 7, 2021, the Form Recognizer service introduced new clients to leverage its latest features.
A new DocumentAnalysisClient was added, which includes begin_analyze_document and begin_analyze_document_from_url methods for analyzing documents with prebuilt and custom models.
The new client supports the latest Form Recognizer API version, allowing for more advanced document analysis capabilities.
The DocumentAnalysisClient is used with the DocumentAnalysisApiVersion, which is now available for use with the client.
![A Laptop Near the Plant and Documents on the Table](https://images.pexels.com/photos/5520296/pexels-photo-5520296.jpeg?auto=compress&cs=tinysrgb&w=1920)
New models were introduced, including AnalyzeResult, AnalyzedDocument, and DocumentElement, among others, to work with the new client.
The new models provide more detailed information about the analyzed documents, including bounding regions, document entities, and document fields.
Here's a list of the new models added with the DocumentAnalysisClient:
- AnalyzeResult
- AnalyzedDocument
- BoundingRegion
- DocumentElement
- DocumentEntity
- DocumentField
- DocumentKeyValuePair
- DocumentKeyValueElement
- DocumentLine
- DocumentPage
- DocumentSelectionMark
- DocumentSpan
- DocumentStyle
- DocumentTable
- DocumentTableCell
- DocumentWord
The DocumentModelAdministrationClient was also added, providing methods for building, creating, and managing document models.
This client includes methods for building models, creating composed models, and copying models, among others.
The new client supports the following models:
- DocumentModel
- DocumentModelInfo
- DocTypeInfo
- ModelOperation
- ModelOperationInfo
- AccountInfo
- DocumentAnalysisError
- DocumentAnalysisInnerError
The new clients also include to_dict and from_dict methods for all models, making it easier to work with the data.
3.1.2 (2021-08-10)
In this update, a significant change was made to the way Form Recognizer handles call quota volumes. A HttpResponseError will be immediately raised when the call quota volume is exceeded in a F0 tier Form Recognizer resource.
This means that if you're using the F0 tier, you'll need to keep a close eye on your call quota volume to avoid hitting this limit.
A HttpResponseError is a specific type of error that will be raised, so make sure you're prepared to handle this scenario in your code.
In the past, we've seen developers struggle with quota limits, so this change is a welcome addition to help prevent these issues.
3.1.0b1 (2020-11-23)
![Magnifying Glass on Top of Document](https://images.pexels.com/photos/6801648/pexels-photo-6801648.jpeg?auto=compress&cs=tinysrgb&w=1920)
The 3.1.0b1 version of the SDK is a significant update that defaults to the latest supported API version, which is v2.1-preview.
This version introduces new methods for recognizing data from business cards and invoices, making it easier to extract relevant information from these documents.
The SDK now supports recognizing receipts with improved results by specifying the locale of the receipt.
Recognize receipt methods now take a keyword argument locale to optionally indicate the locale of the receipt.
The ability to create a composed model from the FormTrainingClient is now available by calling the begin_create_composed_model() method.
This version adds support to train and recognize custom forms with selection marks such as check boxes and radio buttons.
Here are some of the key features and updates in this version:
- New methods begin_recognize_business_cards and begin_recognize_business_cards_from_url introduced to the SDK.
- New methods begin_recognize_invoices and begin_recognize_invoices_from_url introduced to the SDK.
- Recognize receipt methods now take keyword argument locale to optionally indicate the locale of the receipt.
- Added ability to create a composed model from the FormTrainingClient by calling method begin_create_composed_model().
- Added support to train and recognize custom forms with selection marks such as check boxes and radio buttons.
The SDK now includes a new property called selection_marks, which contains a list of FormSelectionMark.
![A Woman Having Coffee while Looking at a Document](https://images.pexels.com/photos/8134243/pexels-photo-8134243.jpeg?auto=compress&cs=tinysrgb&w=1920)
The property field_elements on FieldData and FormTableCell will also be populated with any selection marks found on the page when passing include_field_elements=True.
The appearance property is now added to FormLine to indicate the style of extracted text.
The SDK now supports content-type image/bmp for recognize content and prebuilt models.
Here are the dependencies updates:
- Package now requires azure-common version 1.1.
1.0.0b4 (2020-07-07)
The 1.0.0b4 release on July 7, 2020, brought some significant changes to the RecognizedReceipts class, which has been removed altogether.
This change affects several methods, including begin_recognize_receipts and begin_recognize_receipts_from_url, which now return a RecognizedForm instead.
Several field names have been renamed, including requested_on to training_started_on and completed_on to training_completed_on on CustomFormModel and CustomFormModelInfo.
FieldText has been renamed to FieldData, and FormContent has been renamed to FormElement.
Some parameter names have also been updated, with include_text_content now being called include_field_elements for begin_recognize_receipts, begin_recognize_receipts_from_url, begin_recognize_custom_forms, and begin_recognize_custom_forms_from_url.
Additionally, text_content is now referred to as field_elements on FieldData and FormTableCell.
A bug fix has also been included in this release, which addresses an issue where text_angle was being returned outside of the specified interval (-180, 180].
1.0.0b3 (2020-06-10)
![Person choosing document in folder](https://images.pexels.com/photos/4792285/pexels-photo-4792285.jpeg?auto=compress&cs=tinysrgb&w=1920)
With the release of 1.0.0b3, several changes were made to improve the Form Recognizer API. The asynchronous long running operation methods now return an instance of an AsyncLROPoller from azure-core. This change allows for more flexibility and control when working with these methods.
All asynchronous long running operation methods are now prefixed with "begin_" to indicate that an AsyncLROPoller is returned. For example, the sync method "begin_train_model" has been renamed to "begin_training". This change helps to clarify the purpose of these methods and makes it easier to use them correctly.
The training_files parameter of begin_training is now called training_files_url, and the use_labels parameter is now called use_training_labels. This change is likely intended to make the parameter names more descriptive and easier to understand.
Sync method begin_train_model is now renamed to begin_training.
A HttpResponseError is now raised if a model with status=="invalid" is returned from the begin_training methods. This change helps to prevent invalid models from being trained and ensures that the API returns an error instead.
The following table summarizes the changes to the begin_training method:
The list_model_infos method has been renamed to list_custom_models. This change is likely intended to make the method name more descriptive and easier to understand.
Frequently Asked Questions
What is the difference between AI Builder and Azure form Recognizer?
AI Builder and Azure Form Recognizer serve different purposes, with AI Builder focusing on image recognition and object detection, while Azure Form Recognizer extracts and analyzes text and data from documents. If you need to identify objects in images, use AI Builder; for document data extraction, use Azure Form Recognizer.
Which three models are included with form Recognizer?
Form Recognizer includes three models: Read, Layout, and General document model, which extract content structure and fields from forms and documents. These models cater to various document types and extraction needs.
What is the new name of form recognizer?
Azure Form Recognizer is now known as Azure AI Document Intelligence, offering enhanced capabilities. This name change reflects the service's expanded features and functionality.
In which scenario can you use the form recognizer service?
You can use the Form Recognizer service to extract information from forms like purchase orders and invoices with a deep understanding of their meaning. This AI-powered tool is ideal for complex form data extraction scenarios.
What is the Azure OCR service?
The Azure OCR service is a powerful tool that extracts text from images, including printed and handwritten text, using advanced deep-learning-based models. It can read text from photos and documents, regardless of the surface or background.
Sources
- https://www.beyondkey.com/blog/azure-form-recognizer/
- https://pypi.org/project/azure-ai-formrecognizer/
- https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-ai-form-recognizer/3.1.0/index.html
- https://www.winwire.com/blog/azure-form-recognizer/
- https://www.nuget.org/packages/Azure.AI.FormRecognizer
Featured Images: pexels.com