Analyze Invoices with Oracle Analytics and AI Document Understanding

OCI Document Understanding is an AI service that enables developers to extract text, tables, and other key data from document files through APIs and command line interface tools.


In this blog I will show you how we can visualize invoices in oracle analytics using AI document understanding pre-trained model.

Pre-requisite:

1. Upload sample invoices in OCI bucket object storage.

2. Create a Oracle Analytics Could Instance in OCI.


Steps:

1. Create a CSV file:

Once we have all invoice images in bucket, we have to create a CSV file including your bucket URL.

something like below.


2. Register model in Oracle Analytics Cloud:

Go to Analytics home page and click on 3 dots on top right corner and select Register Model/Function and then select OCI Document Understanding Models


Once selected, create a new connection by clicking create connection button. I already have connection so I select that.

On next screen you have to select Model, I select Pretrained Document Key Value Extraction and select compartment, bucket (where we upload all invoices), document type (I select invoices) and give any name to Model.


3. Apply AI model to our images:

On Analytics home page , Click on Create button from top right corner and click Data Flow.


On this screen we have to choose the CSV file we created in Step 1 and click add.


You will see below screen


Now click on the + sign and click on Apply AI model and select the model we created in step 2 and click ok.

scroll down and under parameters select the column as Bucket URL.



Now again click on + sign and select Save data. Saved data should contain the image name and URLs as well as the key values text/number extracted.


Now after few mins you will see all the data. Data flow will load the images, analyze them with pre-trained AI model and extract key values from the images. In this example, the invoices.


Data flow will load all the information into dataset that we can use to explore and visualize.

4. Now Visualize the dataset:

From Oracle Analytics home page again click on create and click workbook


Click on new dataset generated by data flow in previous step and add to workbook.



Now from the Visualization, add the custom visualization plugin object to see all the images in your bucket.

On how to download and use custom visualization see my other blog custom plugin



Create a new table to show all the columns of your dataset or may be few columns whatever required.

something like below


I use the filter on image objects so when I click on any image it will show the data of that invoice on right side.


This is really cool! You can do many other things like to show only invoices where Invoice total is more than $1000 etc.

You can also store the dataset result in Autonomous database to do more things.

Hope you like the Blog!




No comments:

Post a Comment

Analyze Invoices with Oracle Analytics and AI Document Understanding

OCI Document Understanding is an AI service that enables developers to extract text, tables, and other key data from document files through...