Query Group extraction tips

This Sensible Instruct method extracts individual facts in a document, such as the date of an invoice, the liability limit of an insurance policy, or the destination address of a shipping container delivery. When you configure the Multimodal Engine parameter, this method can extra data from non-text images, such as photographs, charts, or illustrations. For an example, see Example: Extract from images

Sensible recommends grouping queries together if they share context. Queries share context when data exists in the same location or region of a document, for example, on the same page. You can configure context using Advanced prompt configuration.

For example, contact information can usually be found in the same location of a document:

New York City, NY
(123) 456-7890
[email protected] 

Combining queries for the location, phone number, and email into the same group will help you maximize the accuracy and speed of your extractions. Frame each query, or prompt, in the group so that it has a single, short answer. Sensible recommends a maximum group size of 10 queries.

Prompt Tips

Troubleshooting

  • For information about troubleshooting LLM error messages, see Qualifying LLM accuracy.

  • You can view the source text for an LLM's answer highlighted in the document. In the Sensible Instruct editor, click the Location button in the output of a query field to view its source text in the document. For more information about how location highlighting works and its limitations, see Location highlighting.

    Click to enlarge

  • To troubleshoot locating a group's context in the document, ensure that the Page Hinting parameter is enabled, then add location information to a prompt in a group. For more information about the Page Hinting parameter, see Advanced prompt configuration.

    Location relative to page number and position on page

    • "address in the top left of the first page of the document"

    • "What is the medical paid value on the last claim of the second page?"

    • "consumer electronics device with highest sales mentioned near end of document"

      Location relative to content in document

    • "total amount in the expense table"

    • "phone number after section 2"

Examples

Example 1

The following example shows using the Query Group method to extract agricultural data from a government report:

Click to enlarge

To try out this example in the Sensible app, take the following steps:

  1. Download the following example document:

    Example documentDownload link
  2. Create a test document type in the Sensible app, then click the document type you created to edit it. In the document type's Reference documents tab, upload the example document you downloaded in a previous step.

  3. Click the document type's Configurations tab, create a new test configuration, and click the configuration you created to edit it.

  4. Ensure that you're in the Sensible Instruct editor. Click Query group create the following queries to extract data using the following table:

Prompt(Optional) Type
tenancy terms start dateDate
tenancy terms end dateDate
number of days notice for tenant must give to terminate leaseString
monthly rents in dollarsCurrency
when is the rent due in the monthString
grace period for the rent dueString
late fee amountString
fee in dollars for returned checks or rejected paymentsCurrency

Click to enlarge

Notes

For the full reference for this method in SenseML, see Query group method.