evopimp / documentai-sheets-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DocumentAI Sheets Plugin

A demo for Google Spreadsheet to run Document AI to extract documents and add entities to the sheet. This demo is a proof-of-concept to showcase the capability of Document AI technology.

image

image

Setting Started

This section covers the steps to set up the DocumentAI Sheets Plugin demo using the sample Gogole Sheets.

Make a copy of the Demo Spreadsheet

Setting Up

  • Initialize the spreadsheet: Select Menu > Document AI > Initialize

image

  • Click "Continue" to authorize the Sheets.

image

Setting up with your Google Cloud Project ID

  • Filling your Google Cloud Project ID in the README tab in the sample Spreadsheet.

image

Setting up OAuth token

  • Go to Google Cloud Console and open up Cloud Shell

    image
  • Go to Google Cloud Console and open up Cloud Shell

  • Run the following command in Cloud Shell to retrieve the Oauth Token:

$ gcloud auth print-access-token
  • Copy and paste the Oauth token to the field on the Sheet.

image

Note OAuth Token will usually expire in 60 minutes. For this demo, you will need to re-generate new Oauth token periodically.

Set up Document AI processors

image

image

  • Go to Document Types tab, add your Document Type and the Document AI processor ID like below.

image

List all Field Keys in a Document

  • Select Menu > Document AI > Process a document in Drive
  • Select a file in your Drive, or search with keywords.
  • Select a document type from the list (defined in the Document Types tab)
  • Click "Retrieve Field Keys" button. This will populate and append all fields in the "Fields" tab.
  • Go to "Fields" tab and update the "New Field Key" column, which will be used as the field keys in the destination tab. (e.g. Application Form tab)

Customize your result tabs

In each Result tab (e.g. Application Form tab), the field key column are automatically populated based on the "Fields" Tab. To customize your result tab, there are a few options:

  • Update the Field Key mapping in the "Fields" tab. For example, you can run and Retrieve all original field keys from a document first (See section 3)
  • Remove some fields rows that you don't need.
  • Then, update the "New Key Field" column for each row to whatever you prefer.
  • Last, reorder the fields to the order you prefer to show in the result tab.

Process a document from Drive

  • Select Menu > Document AI > Process a document in Drive
  • Select a file in your Drive, or search with keywords.

image

  • Select a document type from the list (this is defined in the Document Types tab)

image

  • Click "Submit" button. This will process the document via Document AI and populate all fields to the corresponding tab.

Note Note: The mapping of Document Type to result tab is defined in the "Document Types" tab.

  • Once processed, you will see a new row showed up in the result tab.

image

About

License:Apache License 2.0


Languages

Language:JavaScript 91.4%Language:HTML 5.3%Language:Shell 3.3%