1040 Forms

This section describes how to build your custom OCR API to extract data from 1040 Forms using the API Builder. A 1040 Form is one of the official documents that U.S. taxpayers use to file their annual income tax returns.

Prerequisites

You’ll need at least 20 1040 Form images or PDFs to train your OCR.

Define Your 1040 Forms Use Case

Using the 1040 Form below, we’re going to define the fields we want to extract from it.
1040 Forms

  • 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 this example. Feel free to add any other relevant data that fits your requirement.

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 follow these steps:

  1. Click on the Create a new API button on the right.

  2. Next, fill in the basic information about the API you want to create as seen below.

1124

Set up your model

  1. Click on the Next button. The following page allows you to define and add your data model.

Define Your Model

There are two ways to add fields to your data model.

2852

Upload a JSON Config

To add data fields using JSON config upload.

  1. Copy the following JSON into a file
{
  "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"
      ]
    }
  }
}
  1. Click on Upload a json config
  2. The data model will be automatically filled.
  3. Click on Create API at the bottom of the screen.
2808

Manually Add Data

Using the interface, you can manually add each field for the data you are extracting. 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, click the Create API button at the bottom of the screen.

2808

Ready to train model

Train Your 1040 Forms OCR

You’re all set! Now it's time to train your 1040 form deep learning model in the Training section of our API.

1315

Train your model

  1. Upload one file at a time or a zip bundle of many files.
  2. Click on the field input on the right, and the blue box on the left highlights all the corresponding field candidate in the document.
  3. Next, click on the validate arrow for all the field input.
  4. Once you have selected the proper box(es) for each of your fields as displayed on the right-hand side. Click on the validate button located at the right-side bottom to send annotation for the model you have created.
  5. Repeat this process until you have trained 20 documents to create a trained model.

To get more information about the training phase, please refer to the Getting Started tutorial.

 

Questions?
Slack Logo Icon  Join our Slack