Build

In AI Hub Build, you can create a custom document understanding app in just a few steps. Upload sample documents, tell Build what document types and data points you want to identify, then publish your app for use.

Build community and commercial offerings

Build is available in two tiers: a community offering available for general use, and a commercial offering suitable for companies and organizations.

For plan comparisons and pricing, see Instabase pricing.

A Build community account lets you create a basic document understanding app and publish it for use.

A Build commercial account lets you collaborate on projects, perform advanced cleaning operations, validate results, and more.

Using the Build interface

Understanding the Build interface can help you efficiently build document understanding apps.

The default Build interface includes three main panels:

  • The document list on the left displays all files included in your project. If your project includes classification, documents are automatically grouped by class, but you can use the filter, sort, and group icons to change the list display.

  • The document preview in the center displays the document selected in the document list. The preview pane includes a toolbar, auto-hidden by default, with controls for viewing the selected document, including image or text-only views, keyword search, and page selection. Alternatively, you can use the icons at the top to replace both the document list and document preview with thumbnails or a table view of all documents in your project.

  • The editing panel on the right displays classes and fields in your project, with results for the document selected in the document list. In projects that belong to commercial accounts, a validation tab lets you view, create, and edit validation rules across your project, while class and field controls are displayed in a separate schema tab.

Working with projects

A project is a collection of files and artifacts used to create a Build app. Projects correspond to your unique document understanding workflow, with document types and data points that address your specific use case.

You can view and modify project settings by clicking the gear icon next to any project in the main sidebar. Project settings include options for detecting checkboxes and multipage tables.

Info

If you enable object detection after initial file upload, any existing files are automatically redigitized according to your new settings.

Creating a project

To get started building a custom app, create a project and add files.

Before you begin

You must have a set of files that represent the types of documents you want to process. Five or so files of each type is a good start. For best results, each file must contain a single document.

  1. Commercial In the sidebar under your organization name, verify the workspace in which to create the project.

    Note

    For community users, all projects are created in your personal workspace. Commercial users can create projects in a personal workspace or shared workspace. Projects created in a shared workspace can be accessed and edited by all members of the shared workspace.

  2. Click New Project or the + icon.

  3. Select files to start building with.

    Files are uploaded to your project, then digitized and processed according to your project settings. Documents are added to the document list as they finish processing.

Tip

You can also create a Build project directly from the My Hub tab. In the target workspace, click the + icon next to the Projects header.

Supported file types

These are the file types that are supported for Build import. For best results, each file must contain a single document.

Files can be up to 50 MB, and each project can contain up to 50 files.

  • PDF

  • PNG

  • JPEG

  • JPG

  • TIF

  • TIFF

  • DOCX

  • XLSX

  • CSV

  • PPTX

  • MSG

  • EML

  • TXT

  • HTML

  • MHT

  • MHTML

Processed results can be exported in CSV or Excel format.

Collaborating on projects Commercial

You can collaborate on Build projects with other members of a shared workspace by creating your project in that shared workspace. Collaboration in Build uses a combination of exclusive edit access and a timed lock system to mitigate the risk of conflicts or another member overwriting your changes.

Exclusive edit access means that only one user can edit a project at a time. Examples of actions that initiate edit access include clicking Save, uploading a document, and renaming a field or the project. When you hold edit access, a banner displays at the top of the page.

The timed lock system means you can only retain exclusive edit access while actively editing the project. While you can actively edit a project for as long as needed, after a period of five consecutive minutes of inactivity, another member of the shared workspace can take over exclusive edit access and initiate their own timed lock. If another user takes over edit access, any unsaved changes made prior to the five minute period of inactivity are lost.

Creating classes and fields

To process documents, you must specify which data points, or fields, you want to extract. If your project includes different document types, like a mix of passports and driver’s licenses, you can create a class for each document type and specify a different set of fields for each class.

You can create up to 50 classes per project, and up to 50 fields per class.

Creating classes

If your project includes different document types, start by creating a class for each document type. You can then specify a different set of fields for each class.

In projects with classification, a default class called other is assigned to documents that can’t be classified. You can’t delete or modify this class.

  1. In the editing panel, on the Schema tab, click the Create classes icon Icon that looks like a horizontal bookmark or tab, with a small plus in the lower right. to add a class.

  2. Enter a descriptive name for one of your document types, and press Enter.

  3. Use the Create classes icon Icon that looks like a horizontal bookmark or tab, with a small plus in the lower right. to add more classes as needed.

  4. When you’re done creating classes, click Reclassify documents.

    Build assigns classes to your documents and groups documents by class in the document list. Any documents that can’t be classified are assigned the other class.

Creating fields

Create fields for each of the data points you want to identify.

For straightforward extraction projects, the field name effectively doubles as the model prompt. To specify a succinct field name with a more descriptive prompt, or to specify reasoning prompts, create placeholder fields and then edit them.

  1. In the editing panel, on the Schema tab, click Create field.

  2. Add fields as needed to the Create fields list using one of these methods:

    • Select a suggested field.

    • Enter your own field name, or a comma-separated list of field names.

  3. Click Create.

  4. (Optional) If your project includes classes, expand each class and add fields appropriate to each document type.

  5. When you’re done creating fields, click Save fields.

    Build extracts data points from your documents based on the fields you specified.

Editing prompts

If the field name doesn’t adequately describe the data you want to extract, you can edit the field and provide a more descriptive prompt.

To edit a field, hover over the field and click the Edit field icon Pencil icon.. In the field editor, you can provide a natural language prompt and specify whether you want the model to use extraction or reasoning to generate results.

Extraction versus reasoning prompts

Extraction prompts describe data you want to extract in natural language. Extraction prompts are appropriate when your document includes the information you want to identify. When results are returned, the data is highlighted in the corresponding document. Examples of extraction prompts include:

  • What time period does this statement cover?

  • Is the filer claiming capital gains or losses?

Reasoning prompts are queries that require summarization, calculation, or extrapolation. Reasoning prompts are appropriate when the information you want isn’t explicitly found in the document, but can be deduced. Examples of reasoning prompts include:

  • What’s the description for the largest debit on this statement?

  • Summarize this document in less than 200 words.

Viewing results across documents

To quickly scan or compare results for a given field, you can view results across all documents in the class.

To access a table of results, in the field editor for any field, click the View results across documents icon Icon that looks like a 2x6 table..

Improving class and field results

One of the most effective ways to improve results is to provide a field name or prompt that uses wording directly from your sample documents. Models are often most effective at identifying specific information if you give them clear signposts.

For example, if you’re working with bank statements and want to extract total withdrawals, locate this information on a sample document and use its corresponding label in your prompt. Keep in mind that this wording might differ across document classes, so your prompt should also be different. On a Chase bank statement, this information might be labeled Electronic Withdrawals, whereas on a Capital One statement, it might have the label Checks/Debits.

Similarly, when classifying documents, give your classes names that correspond to information actually contained in your sample documents, such as in the document header. File names aren’t usually an effective method of classifying documents.

Extracting objects

You can effectively extract tables, checkboxes, and signatures using specific settings and prompts.

Info

To extract multipage tables and checkboxes, you must first enable object detection in project settings.

Extracting tables

Basic tables can be extracted with either an extraction or reasoning prompt, but only an extraction prompt highlights source data in the document.

Tip

To see the tables identified in a document, with object detection enabled, select the prediction icon Lightbulb icon. in the header and enable Show detected objects for tables. Tables in the document are highlighted and you can use the adjacent table icon to view, copy, or download a table.

By default, tables are returned in Markdown. Alternatively, you can specify JSON results. For example:

  • Extract transactions table

  • Extract transactions table and return in JSON format

Using a reasoning prompt, you can filter columns or rows, sort columns, and perform other manipulation of table data. For example:

  • Extract transactions and filter for amounts greater than $1,000

  • Extract transactions and return results for 01 May through 15 May

  • Extract transactions table and sort amounts from smallest to largest

  • Extract transactions and add a column Flagged with values set to Yes if the debit is greater than $70

For tables that span multiple pages, use a reasoning prompt, include the phrasing Extract all tables, and optionally specify the column names. For example:

  • Extract all tables in this document with columns Date, Transaction Details, Debit, Credit and return in Markdown
Note

Multipage tables are extracted most successfully when they have a header row with consistent headings as well as clear horizontal rows. You can’t filter out specific columns during extraction.

Extracting checkboxes

Checkboxes can be extracted with either an extraction or reasoning prompt.

  • For a group of checkboxes with a label, such as the Filing Status field on a tax form, use the label for your field name.

  • For a standalone checkbox, use a question that indicates whether the checkbox is ticked. For example, Is the filer claiming capital gains or losses?

Extracting signatures

You can extract information about signatures, including whether a document is signed, who the signer was, and the signature date. Extraction of signature images is not available.

Signature information can be extracted with either an extraction or reasoning prompt, but only an extraction prompt highlights source data in the document when appropriate.

In many cases, a field name like signatory name, signatory title, or signature date is adequate. If field name alone fails to extract the data you want, edit the field and provide a more descriptive natural language prompt. For example:

  • Extract all signatures

  • Return yes if this document is signed

Cleaning results

If results for a given field aren’t formatted as needed, you can clean data using quick clean options or, for commercial users, a natural language prompt or a custom function.

Quick clean

Quick clean options include:

  • Changing character casing to all uppercase, all lowercase, or sentence case.

  • Removing characters by specifying characters to remove, with no comma separator.

  • Reformatting date by selecting from available formatting options.

    Tip

    In numeric-only dates like 06/01/2024, use the Input field to specify whether the original value lists the month or the day first.

Quick clean options use Python functions to reformat data; there is no model processing and no unit cost.

Cleaning prompts Commercial

If quick clean options don’t work for your data, you can instead use a natural language prompt to clean up the output. Prompt-based refinement takes the raw output of your extraction or reasoning prompt and applies whatever instructions you specify in the clean prompt. Effective clean prompts are clear, concise, and detailed.

Custom cleaning function Commercial

For advanced cleaning, you can write a custom function in Python.

For example, you might use a cleaning function to calculate wages minus income tax from a W-2.

Cleaning functions accept these parameters:

Parameter Required? Description
previous_line Required Represents the value of the preceding cleaning line, or the extraction value if the custom function is the first cleaning line.
context Required Stores metadata about the document. You can retrieve the entire text of the document with context['document_text'].
<preceding-field-name> Optional Names of additional fields used in the function. Because fields are extracted sequentially, referenced parameters must precede the current field in the editing panel.

Cleaning functions can return any value. The value is converted to a string when it’s passed to subsequent refinement lines or validation rules. If the cleaning function encounters issues, it must raise an exception.

For additional guidance about custom functions, see Writing custom functions.

Confidence scores Commercial

Extraction prompts return confidence scores that are displayed in the field editor. Confidence scores aren’t supported for reasoning prompts.

Confidence scores are calculated by the model using log probabilities, which provide a mathematical measure of how likely a result is. In internal testing, this method proves reliable when compared to benchmarks.

Validating results Commercial

For commercial users, you can validate fields based on confidence scores or a custom function. In production, fields that fail validation are flagged for human review.

Confidence validation

You can set a confidence threshold across all fields in your project, or you can set confidence thresholds that apply to individual fields within a given class.

  1. In the editing panel, select the Validations tab.

  2. Specify validation rules as needed.

    1. In the Apply to all group, click + Validate and select Extraction confidence.

    2. Enter a project confidence threshold and click Save.

    1. In the class that you want to add a validation rule for, click + Validate and select Extraction confidence.

    2. Select the field to apply the validation rule to, enter a confidence threshold, and click Save.

    Tip

    To see how a validation rule performs across documents, click any rule in the Validations tab to see an aggregate view.

Custom validation function

For advanced validation, you can write a custom function in Python.

For example, you might use a validation function to check that a date is within a certain range.

Validation functions accept these parameters:

Parameter Required? Description
<field-name> Required Value of the field that the custom function validates.
context Required Stores metadata about the document.
context['document_text'] Optional Retrieves the entire text of the document.
context['runtime_config'] Optional Validates results passed as structured data when running an app via API.
<additional-field-name> Optional Names of additional fields used in the function. Referenced parameters must exist within the specified class.

Validation functions must return None if the validation rule passes, and an error string if the validation rule fails.

For additional guidance about custom functions, see Writing custom functions.

Creating your app

Before you finish working on your app, you can preview it and test it with sample documents. This gives you a chance to ensure the app is working the way you want it to.

  1. (Optional) Preview your app with test documents to verify that it’s working as expected.

    1. Click Preview.

    2. Select files to test your app with.

      Files are uploaded, digitized, and processed according to your app settings.

  2. When you’re ready to create your app, click Create app.

  3. Enter a name and optional description for your app, then click Create app.

    Your app is created and published to the Apps tab.

Info

After publishing an app, you can share it with other AI Hub users or other members of your commercial organization.

Processing documents

After creating an app, you can use it to process documents similar to those used in development.

  1. From the Apps tab, open your app.

  2. Commercial Verify the workspace in which to run the app. Run results display only in the selected workspace.

  3. Select files to process.

Each group of documents you process is treated as a batch. The app homepage includes a historical list of batches, with your most recent submission at the top. When the run completes, click the Batch ID to view results.

Tip

You can view in-progress and completed app runs, and access their results, from the App Runs table on the My Hub tab.

Reviewing results Commercial

After processing a batch of documents, you can review and correct class and field data as needed.

If your project includes validation, fields with errors display an error icon.

Before you begin
  1. With a batch of documents open, select a document in the document list.

  2. For each document you’re reviewing, verify and correct data if needed, then mark the document as reviewed.

    • To correct mapping data where multipage files were incorrectly parsed into individual documents, select the Documents Grid tab. Select pages and use the button controls to move or delete pages or create additional documents.

    • To correct classification data, use one of these methods:

      • For documents belonging to only one class, click the Edit classification icon near the assigned class. Select the correct class, then click Confirm.

      • For files that contain multiple documents, select the Documents Grid tab. Next to the classification label on an incorrectly classified document, click Edit. Select the correct class, then click Confirm.

        Tip

        Changing the classification of a document clears any extracted data, resulting in a new set of blank extraction fields appropriate to the class you specify.

    • To correct text fields, on the Single Document tab, in the fields list, select a field. Enter a new value or, in the document viewer, select the area of the document that contains the information for that field. You can click to select text, or use your mouse to draw a box around the information.

      Tip

      If validations apply to the selected document, all fields are automatically revalidated when you modify a value.

    • To correct tables, on the Single Document tab, in the fields list, select a table to open it for editing. Select any table cell, then in the document viewer, select the area of the document that contains the information for that cell. You can click to select text, or use your mouse to draw a box around the information.

  3. (Optional) When your review is complete, download your results as a CSV or Excel file.

Sending results Commercial

You can automatically send results to other apps and systems by configuring an integration. Results don’t include corrections from human review.

Supported integrations include:

  • Email – Send results to an email address in CSV, XLSX, or JSON format. In projects with classes, separate CSV files are generated for each class.

  • Connected drive – Send results to a workspace or organization drive by specifying the path to the drive. Results are saved in CSV, XLSX, or JSON format with a timestamped file name. In projects with classes, separate CSV files are generated for each class.

  • Custom function – Send results in JSON format using a custom Python function.

During configuration, you can test the connection by sending the results from a previous app run to your downstream integration.

Custom integration function

For advanced integrations, you can write a custom function in Python.

For example, you might use an integration function to send results to a webhook:

import requests

# Construct a list of records information
concise_records = []
for record in results['records']:
    concise_record = {
        "fields": record.get("results"),  # Note: This might be intended to be "fields" or a similar key
        "classification_label": record.get("classification_label"),
        "record_index": record.get("record_index")
    }
    concise_records.append(concise_record)

# Post endpoint call template
url = "https://example.com/my_own_webhook"
response = requests.post(url, json=concise_records)
if response.status_code == 200:
    print("POST request successful")
else:
    print(f"POST request failed with status code {response.status_code}")
    return None

Integration functions accept these parameters:

Parameter Required? Description
results Required Results of the app run in JSON format. Individual documents within the app run are exported as records[0].results.

For additional guidance about custom functions, see Writing custom functions.