Quickstart: Form processing in the console

This quickstart introduces you to Document AI. In this quickstart, you will use the Google Cloud Console to set up your Google Cloud project and authorization, create a form parser, and then make a request for Document AI to process a form PDF document.

Before you begin

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Cloud Console, on the project selector page, select or create a Cloud project.

    Go to the project selector page

  3. Make sure that billing is enabled for your Google Cloud project. Learn how to confirm billing is enabled for your project.

  4. Enable the Cloud Document AI API.

    Enable the API

  5. Set up authentication:
    1. In the Cloud Console, go to the Create service account key page.

      Go to the Create Service Account Key page
    2. From the Service account list, select New service account.
    3. In the Service account name field, enter a name.
    4. From the Role list, select Project > Owner.

    5. Click Create. A JSON file that contains your key downloads to your computer.
  6. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again.

  7. Install and initialize the Cloud SDK.

Create a form parser

Use the Google Cloud Console to create a new form parser:

  1. Open the Document AI dashboard.

    Go to the Document AI dashboard

  2. Click Create processor.

  3. In the Create processor page, select the Form parser option.

    Form parser option in UI

  4. In the side window, name your processor quickstart-form-processor and choose your region.

  5. Click Create. You will be taken to the details page of your newly created form processor.

Send the request to the form parser

After creating your processor you can send annotation requests to it.

  1. Save a local copy of the sample form document (gs://cloud-samples-data/documentai/loan_form.pdf). This document is stored in a publicly accessible Cloud Storage bucket.

  2. In the Test your processor section of the processor detail page, upload the local version of the sample form. This takes you to the document analysis page where you can view the document annotations returned.

    annotated sample form in UI

Clean up

To avoid unnecessary Google Cloud charges, use the Cloud Console to delete your processor and project if you do not need them.

What's next