Document Understanding AI — Google Cloud Explained
By: Agaram Tharun
Tags: Artificial Intelligence, Machine Learning, Google Cloud Platform, Data Science, Automl

Hey, folks How are you doing. Today I am going to discuss Document Understanding AI using Google cloud in simple steps. I know I know you say there is a lot of complexity!!!. Don’t worry folks Google cloud platform is going to make your life easier!!. Additionally, GCP gives you 300 dollars free for the first year!!!

Let's get into details ………………..

Does your company have a lot of PDF files that your employees have to check and enter into the database manually?

Do you want to automate this process using AI so that the AI model will automatically fetch the required content from the document and can enter into your database or form automatically?

Yes!

Are you looking for a cool final year project that can boost your career?

Yes!

Then you are on the right blog!!!!!. just follow the series of blog posts………

We are using AutoMl NLP API to extract the useful entities (text content) from our documents. The series of blog posts discuss the below steps in detail

1. Prepare your train data set using Google Cloud Vision API and Create the model using Auto ML entity extraction API.

2. Create a Data pipeline using cloud functions to make the model production ready!

I am going to discuss the first step in this post. So fasten your seat belt we are going for a ride………….

Preparing your train dataset using Google Cloud Vision API and Create the model using Auto ML entity extraction API.

Initially just select a document you want to automate and collect at least 150 samples of the document.

Then select the entities you want to extract for example say you want to extract name, amount, address and country from this document.

Now you pass these 150 files to Google Cloud vision API and generate the text files using python code (code-1). Additionally, you have to create a service account for connecting to google cloud.

So the corresponding text file generated for this document is as follows……..

Now upload these files to Google Cloud Storage using python helper function shared in the below link(code-2)

Since AutoML API expects the input in JSON format we use a python helper function that converts the text files into JSON format.

Now you have to create a dataset in the AutoML NLP dashboard. Once you create a dashboard you have to import the dataset by selecting the corresponding bucket.

Now you can see all the text files in the dashboard and you have to annotate name, amount, address and country accordingly in all 150 files as shown in the below image.

Once you are done with annotation hit the train button in the dashboard and the model will be trained automatically. It will take around 4–5 hrs based on the complexity of your dataset.

Once the model is created you can check the accuracy of the model by hitting on evaluate in the dashboard and you can use this model for predicting new data by using Rest API or Python API displayed in the dashboard.

Now by using this model you can automate the tedious task of manual document entry by your employees. This solution will save valuable time and money.

In the next part, I will be discussing how can we make this model production-ready and can be used in real-world using cloud functions to stay tuned….

GitHub account for code: https://github.com/TharunAts/Document_Understanding_AI

Follow @ https://www.linkedin.com/in/tharun-agaram/

References: