Effectively analyzing documents

To effectively analyze documents in a conversation or chatbot, it helps to understand what functionality is supported. The following sections provide tips for effective analysis, including an overview of supported functionality, querying techniques, and more.

Writing effective questions

Follow these tips to write more effective questions.

Provide clear instructions

Use verbs like extract, identify, calculate, find, explain, and summarize, depending on your documents and question. If you want the answer in a structured format such as a table or in JSON, specify the result format explicitly.

Basic queryBetter query
What is gross pay?Extract gross pay of the person (year to date).
Summarize this document.Summarize this document in less than 200 words, in a list format with bullet points.
What is the % increase in net sales from 2019 to 2022?Calculate the % increase in net sales from 2019 to 2022. Explain the calculation.
What is the issuing state in this driver’s license?Extract the issuing state’s two-letter State Code (for example, CA for California) in this driver’s license. Don’t confuse it with the country name (USA).
Identify all beneficiaries in this trust document along with the beneficiary type.Identify all the beneficiaries in this trust document. Extract them all in a table format along with the beneficiary type.

Ask the model to think step-by-step

Especially for complex tasks, ask the model to think step-by-step by adding “explain step by step” to the end of your query. When the model focuses on each task individually, it improves the accuracy of each response.

Basic queryBetter query
What is the annual growth of net sales from 2019 to 2022?Calculate the annual growth of net sales from 2019 to 2022. Explain step by step.
What is the answer to question 4 in the math test?Answer question 4. Explain step by step.
What is the total amount deposited in this bank account in May 2023?Calculate the total amount deposited in this bank account in May 2023. Explain step by step.

Provide additional context

Give the model more context about your question to help it better understand what information you need.

Basic queryBetter query
What is the increase in net debt of the company in the last three years?I’m an investment banker analyzing companies for investment. Calculate the increase of net debt of the company in the last three years. Explain how this can impact my return on investment.
What is the increase in net debt of the company in the last three years?I’m a college student solving an assignment for a course. Calculate the increase in net debt of the company in the last three years. Explain how this compares to companies in the S&P 500 index.
Summarize this document.Summarize the transactions from the bank statement for the period of March to May 2023.

Specifying result formats

The model can return responses in plain text or in other formats, including rich graph formats such as tables, lists, charts, and code blocks. These result formats can be copied or converted into other formats and downloaded. Supported actions are displayed in the corner of the response, either by default or on hover.

Available formats for responses include:

  • Tables, which are rendered in the response. Hover over the corner of the rendered table to see supported actions, including copying the table in tab-separated values (TSV) format, downloading it as a CSV file, or expanding it.

    While rendered tables copy in TSV format, if you copy the entire response, any tables in the response paste in Markdown format. To copy the entire response, use the copy icon Icon of two rounded squares, one offset in front of the other. found at the bottom of the response, rather than the copy icon displayed when hovering over the table.

    You can also specifically request that tables be returned in JSON format. JSON tables are returned as a code block.

  • Charts, including line, bar, column, pie, scatter, and multi-axis. Charts are also downloadable as CSV, PNG, or SVG files.

  • Code blocks, with more than 25 formats available, including JSON, Python, bash, and JavaScript.

To get results in a specific format, request that format in your query. For example:

Target formatSample query
TableIdentify all beneficiaries in this trust document along with the beneficiary type, and return the results as a table.

Identify which funds earned interest in the state of New Jersey, and return the results as a table in JSON format.
ChartShow the payroll deductions as a pie chart.

Show the percent increase in net sales from 2019 to 2022 as a bar chart.
Code blockWrite a Python function that prints the driver’s license number.

Extract the applicant information fields in JSON format.

Querying objects

When processing documents, AI Hub can recognize objects such as tables, checkboxes, signatures, and barcodes.

  • Signature and barcode recognition is automatically enabled and supported in both conversations and chatbots.

  • By default, basic table and checkbox recognition is supported in conversations and chatbots. You can enable advanced table and checkbox recognition in a conversation by adjusting its digitization settings (enable Recognize visual objects > Tables or Checkboxes).

    Advanced table and checkbox recognition isn’t supported in chatbots, even if enabled in the origin conversation. You can still reference tables and checkboxes in your chatbot query, but results might be poorer or less accurate than in a conversation.

Tables

To extract information from all tables in a document, begin your query with Extract all tables. For example:

  • Extract all tables in @income-fund-reporting.pdf.

  • Extract all tables and return in JSON format.

To extract information from a single specific table in a document, include the title or header of the table in your query. For example:

  • Extract the transactions table for the month of January 2023.

  • Extract the monthly transaction summary for the month of January 2023.

You can also 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.

Table queries are subject to these limitations:

  • Multipage tables might not be extracted correctly unless they have consistent headers on all pages.

  • Source highlighting for tables indicates entire tables, not individual rows, columns, or cells.

Checkboxes

You can extract information from checkboxes in single or multipage documents.

  • For a group of checkboxes with a label, such as the Filing Status field on a tax form, use a query asking about which checkboxes are selected, such as What filing status is claimed?

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

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 isn’t supported.

For example, you can ask:

  • Extract all signatures.

  • Is this document signed?

  • Who signed this document?

  • Are these documents signed by the same people?

Barcodes

You can extract information about barcodes and their embedded values. Both numeric and non-numeric formats and one-dimensional and two-dimensional formats, such as PDF417 or QR codes, are supported. For example:

  • Are there any barcodes in this document? If yes, what are their values?

  • How many barcodes are in this document?

  • What does the QR code in this document link to?

Querying visual elements

With research mode enabled, you can leverage visual reasoning capabilities. The model can analyze visual and stylistic elements, including elements that OCR doesn’t capture, such as images, diagrams, watermarks, layout, colors, text styling, and handwritten markup. Think of it as the model being able to “see” your documents and answer questions about them accordingly. You can ask the model basic questions like What color is the car in this image?, or make more complex requests like asking it to describe a diagram.

To leverage visual reasoning, include keywords in your query, such as image or diagram, or specify a visual element. For example:

  • Explain what happened in the car accident based on the accident diagram.

  • Is any text in @contract-agreement.pdf crossed out?

  • Based on the shaded areas in the pain diagram, where does the patient report experiencing pain?

User interface tips

  • To resend a previous query, click the chat box and press the (upwards arrow) key to populate your last query in the chat box. You can use your arrow keys to move up and down your chat history.

  • You can direct the model to prioritize referencing specific files by including @file-name in your message. In conversations, mentioning files is an alternative to narrowing the message scope to only that file.

    Try using file mentioning to compare one mentioned file against another file. For example, Does the renters insurance claim submission @renter_insurance_submission_janedoe25.pdf meet the requirements outlined in @renter_ins_policy_tristate2025.pdf?

  • When using research mode, it’s noted in the response window. You can make use of this to compare how enabling research mode affects responses to the same query.

  • In conversations with Recognize visual objects > Tables enabled in digitization settings, a prediction icon Light bulb icon. shows in the document view header. Select the icon and enable Show detected objects > Tables to turn on table highlighting. Tables in the document are highlighted and you can use the adjacent table icon to view, copy, or download the table.