page_type | languages | products | urlFragment | name | description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
doc-intelligence-in-a-box |
Doc Intelligence-In-A-Box |
The Doc Intelligence in-a-Box project leverages Azure AI Document Intelligence to extract data from PDF forms and store the data in a Azure Cosmos DB. This solution, part of the AI-in-a-Box framework by Microsoft Customer Engineers and Architects, ensures quality, efficiency, and rapid deployment of AI and ML solutions across various industries. |
Azure AI Document Intelligence empowers organizations to automate form processing. Azure AI Document Intelligence offers:
- Automation: Streamlines the data extraction process from various forms, reducing the need for manual data entry.
- Accuracy: Enhances data accuracy by minimizing human errors during data extraction.
- Efficiency: Saves time and resources by quickly processing large volumes of documents.
- Scalability: Easily handles increasing amounts of data as your organization grows.
- Integration: Seamlessly integrates with existing databases and systems for smooth data management.
- Security: Ensures that extracted data is securely stored and accessible only to authorized personnel.
- Versatility: Works with different types of documents, including handwritten and digital forms.
- User-Friendly: Provides an intuitive interface for reviewing and correcting any flagged data.
Here's a few ways different industries can leverage Azure AI Document Intelligence:
- Healthcare: Extract patient information from medical forms to streamline record-keeping and improve patient care.
- Finance: Automate the extraction of data from financial documents like invoices and receipts for accurate accounting.
- Legal: Digitize and organize information from legal documents to enhance case management and research.
- Retail: Process customer feedback forms and surveys to gain insights and improve service.
- Education: Extract data from student enrollment forms to maintain accurate and up-to-date records.
- Manufacturing: Automate the extraction of data from inspection and quality control forms to ensure compliance.
- Insurance: Process claims forms quickly and accurately to expedite claim settlements.
- Government: Digitize and organize information from various forms to improve public service efficiency.
The solution leverages Azure AI Document Intelligence to extract data from PDF forms and store the data in a Azure Cosmos DB.
-
PDF forms are loaded to a container in Azure Data Lake Storage Gen2 (ADLS Gen2).
-
When the PDFs are loaded to the container, an Azure Logic App is triggered to start the processing of the PDF form(s).
-
The Logic App sends the PDF file location to an Azure Functions app for processing.
-
The Azure Functions app receives the location of file and performs the following:
- Splits the file into single pages if the file has multiple pages, with each page containing one independent form and saves them to an ADLS Gen2.
- Sends the location of the single page PDF file to Azure AI Document Intelligence for processing via a REST API (HTTPS POST)and receives response.
- Prepares the response into the desired data structure.
- Saves the structured data as a JSON file to another ADLS Gen2 container.
-
The Logic App receives the processed response data from the Azure Functions app and sends the processed data to Azure Cosmos DB.
-
The data is saved in the Azure Cosmos DB collections.
-
Power BI is connected to the Azure Cosmos DB to extract data and provide insights.
The solution includes the following:
- Bicep modules which deploy the following Azure resources:
- Instructions for creating, training and deploying the Azure AI Document Intelligence model
- A Power BI Desktop file with reports over the data extracted from the forms and into the Azure Cosmos DB
This solution can easily be modified out of the box with your own PDF forms. This solution includes a labeled dataset generated from PDF files to illustrate the concept. To use the solution with your own forms, create your own labeled datasets, follow this guide on generating labeled datasets. Then train a new model using Azure AI Document Intelligence, as described later.
- Latest version of Azure CLI
- Latest version of Bicep
- Latest version of Azure Developer CLI
- Latest version Azure Functions Core Tools
-
Clone this repo:
git clone https://github.com/Azure-Samples/doc-intelligence-in-a-box
-
Deploy resources:
azd auth login
azd up
After your Azure Resources are deployed, you will upload the sample forms to you Azure Storage account and create a Custom Extraction model in Document Intelligence Studio.
Follow the steps here to create the machine learning custom extraction model.
Now you have a solution that will receive extract data from PDF forms and store the data in a Azure Cosmos DB whenever a PDF form is landed in the ADLS Gen2 container. For testing the solution, we will manually upload the files into the ADLS container. Follow the steps here
Note in your scenario, you would have an application that would land the forms in ADLS (such as Azure Data Factory, an app to extract forms from emails, other applications that sends forms to the storage account, etc.) rather than manually uploading files.
If you wish, you can then see the results of your test in a Power BI report. Follow the instructions here to create a Power BI semantic model and report.. Otherwise, you can just query the Azure Cosmos DB to see the results.
This solution deploys the infrastructure needed for processing form data and loading the data into a database. After deploying the solution in your Azure subscription and testing the solution as described, you can extend the solution to work with you own files and data.
When testing the solution, you will manually upload PDF files to blob storage. For you own environment, you may wish to automate uploading the files to blob storage. There's a host of options to automate the uploading of files, including Azure Data Factory, Azure Logic Apps, Azure Functions, and Power Automate.
This Azure Logic app in this solution loads data into Azure Cosmos DB. You can change the Logic App connection to load the into your preferred Azure Data Platform, including Azure SQL DB, Azure SQL DB or Azure Data Lake Gen2.
Change the Logic App to process files in batch instead of when files are added or integrate the form processing app into your own app
Custom models support other file types as well as PDFs. Read here to see what file types are currently supported
At times, forms may vary in some ways with regards to the form layout. In these cases, where the data extracted is similar but the forms are not exactly the same, a customer neural template may provide better results that a custom template model. Create a custom neural template and test to see if it out-performs the custom template model.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
Highlight the main contacts for the project and acknowledge contributors. You can adapt the structure from AI-in-a-Box:
Contact | GitHub ID | |
---|---|---|
Jean Hayes | @jehayesms | [email protected] |
Chris Ayers | @@codebytes | [email protected] |
If applicable, offer thanks to individuals, organizations, or projects that helped inspire or support your project.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
This project is part of the AI-in-a-Box series, aimed at providing the technical community with tools and accelerators to implement AI/ML solutions efficiently and effectively.