1040 Forms OCR

This article describes how to build an OCR API that extracts data from 1040 Forms using our deep learning engine. If you want to automate your workflow, this article is for you.

Prerequisites

  1. You’ll need a free account. Sign up and confirm your email to login.
  2. You’ll need at least 20 1040 Form images or pdfs to train your OCR.

Define your 1040 Forms use case

First, we’re going to define what fields we want to extract from your 1040 Forms.

1040 form key data extraction

  • First Name: The First name and middle name initial of the taxpayer.
  • Last Name: The Last name of the taxpayer.
  • Spouse First Name: The First name and middle name initial of the taxpayer's spouse.
  • Spouse Last Name: The Last name of the taxpayer's spouse.
  • SSN: The Social Security Number of the taxpayer.
  • Spouse SSN: The Social Security Number of the taxpayer's spouse.
  • Salary: The taxpayer's wages, salaries, tips, etc.
  • Ordinary Dividends: The taxpayer's ordinary dividends (3b)
  • Occupation: The taxpayer's occupation.
  • Spouse Occupation: The taxpayer's spouse's occupation.
  • Identity Protection PIN: The taxpayer's identity protection PIN provided by the IRS.

That’s it for our use case. Feel free to add any other relevant data to fit your requirements.

Deploy your API

Once you have defined the list of fields you want to extract from your 1040 forms, head over to the platform and press the ‘Create a new API’ button.

You land now on the setup page. Here is the image you can use to set up the API. For instance, my setup is as follows:

Set up your model

Once you’re ready, click on the “next” button. We are going to specify the data types for each of the fields we want our API to extract.

Define your model

To move forward, you have two possibilities:

Upload a json config
Copy the following JSON into a file and upload it on the interface

{
  "problem_type": {
    "classificator": { "features": [], "features_name": [] },
    "selector": {
      "features": [
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "first_name",
          "public_name": "First Name",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "last_name",
          "public_name": "Last Name",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "spouse_first_name",
          "public_name": "Spouse First Name",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "spouse_last_name",
          "public_name": "Spouse Last Name",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "is_integer": -1 } },
          "handwritten": false,
          "name": "ssn",
          "public_name": "SSN",
          "semantics": "amount"
        },
        {
          "cfg": { "filter": { "is_integer": -1 } },
          "handwritten": false,
          "name": "spouse_ssn",
          "public_name": "Spouse SSN",
          "semantics": "amount"
        },
        {
          "cfg": { "filter": { "is_integer": -1 } },
          "handwritten": false,
          "name": "salary",
          "public_name": "Salary",
          "semantics": "amount"
        },
        {
          "cfg": { "filter": { "is_integer": -1 } },
          "handwritten": false,
          "name": "ordinary_dividends",
          "public_name": "Ordinary Dividends",
          "semantics": "amount"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "occupation",
          "public_name": "Occupation",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "spouse_occupation",
          "public_name": "Spouse Occupation",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "is_integer": -1 } },
          "handwritten": false,
          "name": "identity_protection_pin",
          "public_name": "Identity Protection PIN",
          "semantics": "amount"
        }
      ],
      "features_name": [
        "first_name",
        "last_name",
        "spouse_first_name",
        "spouse_last_name",
        "ssn",
        "spouse_ssn",
        "salary",
        "ordinary_dividends",
        "occupation",
        "spouse_occupation",
        "identity_protection_pin"
      ]
    }
  }
}

Or build your data model manually
Using the interface, add up to your data model each field.

In our example, here are the different field configurations we used:

  • First Name: type String that never contains numeric characters.
  • Last Name: type String that never contains numeric characters.
  • Spouse First Name: type String that never contains numeric characters.
  • Spouse Last Name: type String that never contains numeric characters.
  • SSN: type Number without specifications.
  • Spouse SSN: type Number without specifications.
  • Salary: type Number without specifications.
  • Ordinary Dividends: type Number without specifications.
  • Occupation: type String that never contains numeric characters.
  • Spouse Occupation: type String that never contains numeric characters.
  • Identity Protection PIN: type Number without specifications.

Once you’re done setting up your data model, press the Start training your model button at the bottom of the screen.

Ready to train model

Train your 1040 forms OCR

Train your model

You’re all set!

Now is the time to train your 1040 form deep learning model in the Training section of our API.

In a few hours (minutes if you're fast), you’ll get your first model trained and will be able to use your custom OCR API for parsing 1040 forms in your application.

To get more information about the training phase, please refer to the Getting Started tutorial. If you have any question regarding your use case, feel free to reach out on our chat!

Updated 28 days ago


1040 Forms OCR


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.