Skip to main content
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. Sensible uses a large language model (LLM) to find data in paragraphs of free text, in images, or in more structured layouts, for example key/value pairs or tables. Create a query group to extract multiple facts that share a context, or are co-located in the document. For tips and troubleshooting, see Query Group extraction tips. For more information about how this method works, see Notes. Parameters
Examples
Notes

Parameters

Note: For the full list of parameters available for this method, see Global parameters for methods. The following table only shows parameters most relevant to or specific to this method. Note You can configure some of the following parameters in both the NLP preprocessor and in a field’s method. If you configure both, the field’s parameter overrides the NLP preprocessor’s parameter. For more information, see Advanced prompt configuration.

Parameters

Query group parameters

Examples

Example: Extract from images

Config The following example shows extracting structured data from real estate photographs embedded in an offering memorandum document using the Multimodal Engine parameter. It also shows extracting data from text.
JSON
Example document
The following image shows the example document used with this example config:
Click to enlarge Output
JSON

Example: Extract handwriting

The following example shows using a multimodal LLM to extract from a scanned document containing handwriting. For an alternate approach to extracting from this document, see also the Sort Lines example. Config
JSON
Example document
The following image shows the example document used with this example config:
Click to enlarge Output
JSON

Example: Extract from lease

The following example shows using the Query Group method to extract information from a lease. Config
JSON
Example document
The following image shows the example document used with this example config:
Click to enlarge Output
JSON

Notes

For an overview of how this method works, see the following steps:
  • To meet the LLM’s token limit for input, Sensible splits the document into equal-sized, overlapping chunks.
  • Sensible scores each chunk by its similarity to either the concatenated Description parameters for the queries in the group, or by the chunkScoringText parameter. Sensible scores each chunk using the OpenAPI Embeddings API.
  • Sensible selects a number of the top-scoring chunks and combines them into “context”. The chunks can be non-consecutive in the document. Sensible deduplicates overlapping text in consecutive chunks. If you set chunk-related parameters that cause the context to exceed the LLM’s token limit, Sensible automatically reduces the chunk count until the context meets the token limit.
  • Sensible creates a full prompt for the LLM (GPT-3.5 Turbo) that includes the chunks, page hinting data, and your Description parameters. For more information about the full prompt, see Advanced prompt configuration.

How location highlighting works

In the Sensible Instruct editor, you can click the search icon to the right of the output of a query field to view its source text in the document. Click to enlarge For an overview of how Sensible finds the source text in the document for the LLM’s response, see the following steps:
  • The LLM returns a response to your prompt.
  • Sensible searches in the source document for a line that’s a fuzzy match to the response. For example, if the LLM returns 4387-09-22-33, Sensible matches the line Policy Number: 4387-09-22-33 in the document. Sensible implements fuzzy matching using Levenshtien distance.
  • Sensible selects the three lines in the document that contain the best fuzzy matches. For each line, Sensible concatenates the preceding and succeeding lines, in case the match spans multiple lines.
  • Sensible searches for a fuzzy match in the concatenated lines for the text that the LLM returned. Sensible returns the best match.
  • Sensible highlights the best match in the document in the Sensible Instruct editor or in the SenseML editor.
Limitations Sensible can highlight the incorrect location under the following circumstances:
  • If you prompt the LLM to reformat the source text in the document or reformat the text using a type , then Sensible can fail to find a match or can find an inaccurate match.
  • If there are multiple candidates fuzzy matches in the document (for example, two instances of April 7), Sensible chooses the top-scoring match. If candidates have similar scores, Sensible uses page location as a tie breaker and chooses the earliest match in the document.
  • If the LLM returns text that’s not in the document, then location highlighting is inapplicable.