Skip to main content
Extracts a table based on your natural-language description of the data you want to extract. This method can extract tables that span multiple pages. For tips on authoring this method in Sensible Instruct, see NLP Table tips. Advantages
  • Low code. Describe what you want to extract in prompts for a large language model (LLM).
  • Can reformat or filter extracted column data based on your prompts.
  • Doesn’t require an anchor.
Limitations
  • Can have a moderate impact on performance. For more information, see Optimizing extraction performance.
  • Suited to tables that have a header row, where each row is a data element. Not suited to tables where the header is in the first column and the columns are data elements.
Alternatives For alternatives to this method, see Choosing a table method. How it works 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.

Examples

The following example shows using the NLP Table method to extract information from tables about insured vehicles and insurance transactions. 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 the NLP Table method works, see the following steps:
  1. To optimize performance, Sensible makes a list of the pages that are most likely to contain your target table. To make the list:
    • Sensible concatenates all your column descriptions with your overall table description.
    • Sensible splits the document into equal-sized, overlapping chunks.
    • Sensible scores your concatenated table descriptions against each chunk using the OpenAI Embeddings API.
    • Sensible gets a list of page numbers from the top-scoring chunks.
  2. Sensible extracts all the tables on the pages most likely to contain your table, using an OCR provider. Sensible supports multi-page tables.
  3. Sensible scores each table by how well it matches the descriptions you provide of the data you want to extract. To create the score:
    • Sensible concatenates all your column descriptions with your overall table description.
    • Sensible concatenates a number of the first rows of the table with the table title. Sensible uses the table title extracted by the table OCR provider, or falls back to using the text in a region above the table if the OCR provider doesn’t find a title.
    • Sensible compares the two concatenations using the OpenAI Embeddings API.
  4. Sensible creates a full prompt for the LLM (GPT-4) that includes the top-scoring table, page hinting data, and your prompts. For more information about the full prompt, see Advanced prompt configuration. The full prompt instructs the LLM to restructure the best-scoring table based on your column descriptions and your overall table description.
  5. Sensible returns the restructured table.